1 /**
2 * React (with addons) v0.14.3
3 */
4(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.React = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
5/**
6 * Copyright 2013-2015, Facebook, Inc.
7 * All rights reserved.
8 *
9 * This source code is licensed under the BSD-style license found in the
10 * LICENSE file in the root directory of this source tree. An additional grant
11 * of patent rights can be found in the PATENTS file in the same directory.
12 *
13 * @providesModule ReactWithAddons
14 */
15
16/**
17 * This module exists purely in the open source project, and is meant as a way
18 * to create a separate standalone build of React. This build has "addons", or
19 * functionality we've built and think might be useful but doesn't have a good
20 * place to live inside React core.
21 */
22
23'use strict';
24
25var LinkedStateMixin = _dereq_(22);
26var React = _dereq_(26);
27var ReactComponentWithPureRenderMixin = _dereq_(37);
28var ReactCSSTransitionGroup = _dereq_(29);
29var ReactFragment = _dereq_(64);
30var ReactTransitionGroup = _dereq_(94);
31var ReactUpdates = _dereq_(96);
32
33var cloneWithProps = _dereq_(118);
34var shallowCompare = _dereq_(140);
35var update = _dereq_(143);
36var warning = _dereq_(173);
37
38var warnedAboutBatchedUpdates = false;
39
40React.addons = {
41 CSSTransitionGroup: ReactCSSTransitionGroup,
42 LinkedStateMixin: LinkedStateMixin,
43 PureRenderMixin: ReactComponentWithPureRenderMixin,
44 TransitionGroup: ReactTransitionGroup,
45
46 batchedUpdates: function () {
47 if ("development" !== 'production') {
48 "development" !== 'production' ? warning(warnedAboutBatchedUpdates, 'React.addons.batchedUpdates is deprecated. Use ' + 'ReactDOM.unstable_batchedUpdates instead.') : undefined;
49 warnedAboutBatchedUpdates = true;
50 }
51 return ReactUpdates.batchedUpdates.apply(this, arguments);
52 },
53 cloneWithProps: cloneWithProps,
54 createFragment: ReactFragment.create,
55 shallowCompare: shallowCompare,
56 update: update
57};
58
59if ("development" !== 'production') {
60 React.addons.Perf = _dereq_(55);
61 React.addons.TestUtils = _dereq_(91);
62}
63
64module.exports = React;
65},{"118":118,"140":140,"143":143,"173":173,"22":22,"26":26,"29":29,"37":37,"55":55,"64":64,"91":91,"94":94,"96":96}],2:[function(_dereq_,module,exports){
66/**
67 * Copyright 2013-2015, Facebook, Inc.
68 * All rights reserved.
69 *
70 * This source code is licensed under the BSD-style license found in the
71 * LICENSE file in the root directory of this source tree. An additional grant
72 * of patent rights can be found in the PATENTS file in the same directory.
73 *
74 * @providesModule AutoFocusUtils
75 * @typechecks static-only
76 */
77
78'use strict';
79
80var ReactMount = _dereq_(72);
81
82var findDOMNode = _dereq_(122);
83var focusNode = _dereq_(155);
84
85var Mixin = {
86 componentDidMount: function () {
87 if (this.props.autoFocus) {
88 focusNode(findDOMNode(this));
89 }
90 }
91};
92
93var AutoFocusUtils = {
94 Mixin: Mixin,
95
96 focusDOMComponent: function () {
97 focusNode(ReactMount.getNode(this._rootNodeID));
98 }
99};
100
101module.exports = AutoFocusUtils;
102},{"122":122,"155":155,"72":72}],3:[function(_dereq_,module,exports){
103/**
104 * Copyright 2013-2015 Facebook, Inc.
105 * All rights reserved.
106 *
107 * This source code is licensed under the BSD-style license found in the
108 * LICENSE file in the root directory of this source tree. An additional grant
109 * of patent rights can be found in the PATENTS file in the same directory.
110 *
111 * @providesModule BeforeInputEventPlugin
112 * @typechecks static-only
113 */
114
115'use strict';
116
117var EventConstants = _dereq_(15);
118var EventPropagators = _dereq_(19);
119var ExecutionEnvironment = _dereq_(147);
120var FallbackCompositionState = _dereq_(20);
121var SyntheticCompositionEvent = _dereq_(103);
122var SyntheticInputEvent = _dereq_(107);
123
124var keyOf = _dereq_(166);
125
126var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
127var START_KEYCODE = 229;
128
129var canUseCompositionEvent = ExecutionEnvironment.canUseDOM && 'CompositionEvent' in window;
130
131var documentMode = null;
132if (ExecutionEnvironment.canUseDOM && 'documentMode' in document) {
133 documentMode = document.documentMode;
134}
135
136// Webkit offers a very useful `textInput` event that can be used to
137// directly represent `beforeInput`. The IE `textinput` event is not as
138// useful, so we don't use it.
139var canUseTextInputEvent = ExecutionEnvironment.canUseDOM && 'TextEvent' in window && !documentMode && !isPresto();
140
141// In IE9+, we have access to composition events, but the data supplied
142// by the native compositionend event may be incorrect. Japanese ideographic
143// spaces, for instance (\u3000) are not recorded correctly.
144var useFallbackCompositionData = ExecutionEnvironment.canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
145
146/**
147 * Opera <= 12 includes TextEvent in window, but does not fire
148 * text input events. Rely on keypress instead.
149 */
150function isPresto() {
151 var opera = window.opera;
152 return typeof opera === 'object' && typeof opera.version === 'function' && parseInt(opera.version(), 10) <= 12;
153}
154
155var SPACEBAR_CODE = 32;
156var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
157
158var topLevelTypes = EventConstants.topLevelTypes;
159
160// Events and their corresponding property names.
161var eventTypes = {
162 beforeInput: {
163 phasedRegistrationNames: {
164 bubbled: keyOf({ onBeforeInput: null }),
165 captured: keyOf({ onBeforeInputCapture: null })
166 },
167 dependencies: [topLevelTypes.topCompositionEnd, topLevelTypes.topKeyPress, topLevelTypes.topTextInput, topLevelTypes.topPaste]
168 },
169 compositionEnd: {
170 phasedRegistrationNames: {
171 bubbled: keyOf({ onCompositionEnd: null }),
172 captured: keyOf({ onCompositionEndCapture: null })
173 },
174 dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionEnd, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
175 },
176 compositionStart: {
177 phasedRegistrationNames: {
178 bubbled: keyOf({ onCompositionStart: null }),
179 captured: keyOf({ onCompositionStartCapture: null })
180 },
181 dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionStart, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
182 },
183 compositionUpdate: {
184 phasedRegistrationNames: {
185 bubbled: keyOf({ onCompositionUpdate: null }),
186 captured: keyOf({ onCompositionUpdateCapture: null })
187 },
188 dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionUpdate, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
189 }
190};
191
192// Track whether we've ever handled a keypress on the space key.
193var hasSpaceKeypress = false;
194
195/**
196 * Return whether a native keypress event is assumed to be a command.
197 * This is required because Firefox fires `keypress` events for key commands
198 * (cut, copy, select-all, etc.) even though no character is inserted.
199 */
200function isKeypressCommand(nativeEvent) {
201 return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&
202 // ctrlKey && altKey is equivalent to AltGr, and is not a command.
203 !(nativeEvent.ctrlKey && nativeEvent.altKey);
204}
205
206/**
207 * Translate native top level events into event types.
208 *
209 * @param {string} topLevelType
210 * @return {object}
211 */
212function getCompositionEventType(topLevelType) {
213 switch (topLevelType) {
214 case topLevelTypes.topCompositionStart:
215 return eventTypes.compositionStart;
216 case topLevelTypes.topCompositionEnd:
217 return eventTypes.compositionEnd;
218 case topLevelTypes.topCompositionUpdate:
219 return eventTypes.compositionUpdate;
220 }
221}
222
223/**
224 * Does our fallback best-guess model think this event signifies that
225 * composition has begun?
226 *
227 * @param {string} topLevelType
228 * @param {object} nativeEvent
229 * @return {boolean}
230 */
231function isFallbackCompositionStart(topLevelType, nativeEvent) {
232 return topLevelType === topLevelTypes.topKeyDown && nativeEvent.keyCode === START_KEYCODE;
233}
234
235/**
236 * Does our fallback mode think that this event is the end of composition?
237 *
238 * @param {string} topLevelType
239 * @param {object} nativeEvent
240 * @return {boolean}
241 */
242function isFallbackCompositionEnd(topLevelType, nativeEvent) {
243 switch (topLevelType) {
244 case topLevelTypes.topKeyUp:
245 // Command keys insert or clear IME input.
246 return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
247 case topLevelTypes.topKeyDown:
248 // Expect IME keyCode on each keydown. If we get any other
249 // code we must have exited earlier.
250 return nativeEvent.keyCode !== START_KEYCODE;
251 case topLevelTypes.topKeyPress:
252 case topLevelTypes.topMouseDown:
253 case topLevelTypes.topBlur:
254 // Events are not possible without cancelling IME.
255 return true;
256 default:
257 return false;
258 }
259}
260
261/**
262 * Google Input Tools provides composition data via a CustomEvent,
263 * with the `data` property populated in the `detail` object. If this
264 * is available on the event object, use it. If not, this is a plain
265 * composition event and we have nothing special to extract.
266 *
267 * @param {object} nativeEvent
268 * @return {?string}
269 */
270function getDataFromCustomEvent(nativeEvent) {
271 var detail = nativeEvent.detail;
272 if (typeof detail === 'object' && 'data' in detail) {
273 return detail.data;
274 }
275 return null;
276}
277
278// Track the current IME composition fallback object, if any.
279var currentComposition = null;
280
281/**
282 * @param {string} topLevelType Record from `EventConstants`.
283 * @param {DOMEventTarget} topLevelTarget The listening component root node.
284 * @param {string} topLevelTargetID ID of `topLevelTarget`.
285 * @param {object} nativeEvent Native browser event.
286 * @return {?object} A SyntheticCompositionEvent.
287 */
288function extractCompositionEvent(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
289 var eventType;
290 var fallbackData;
291
292 if (canUseCompositionEvent) {
293 eventType = getCompositionEventType(topLevelType);
294 } else if (!currentComposition) {
295 if (isFallbackCompositionStart(topLevelType, nativeEvent)) {
296 eventType = eventTypes.compositionStart;
297 }
298 } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {
299 eventType = eventTypes.compositionEnd;
300 }
301
302 if (!eventType) {
303 return null;
304 }
305
306 if (useFallbackCompositionData) {
307 // The current composition is stored statically and must not be
308 // overwritten while composition continues.
309 if (!currentComposition && eventType === eventTypes.compositionStart) {
310 currentComposition = FallbackCompositionState.getPooled(topLevelTarget);
311 } else if (eventType === eventTypes.compositionEnd) {
312 if (currentComposition) {
313 fallbackData = currentComposition.getData();
314 }
315 }
316 }
317
318 var event = SyntheticCompositionEvent.getPooled(eventType, topLevelTargetID, nativeEvent, nativeEventTarget);
319
320 if (fallbackData) {
321 // Inject data generated from fallback path into the synthetic event.
322 // This matches the property of native CompositionEventInterface.
323 event.data = fallbackData;
324 } else {
325 var customData = getDataFromCustomEvent(nativeEvent);
326 if (customData !== null) {
327 event.data = customData;
328 }
329 }
330
331 EventPropagators.accumulateTwoPhaseDispatches(event);
332 return event;
333}
334
335/**
336 * @param {string} topLevelType Record from `EventConstants`.
337 * @param {object} nativeEvent Native browser event.
338 * @return {?string} The string corresponding to this `beforeInput` event.
339 */
340function getNativeBeforeInputChars(topLevelType, nativeEvent) {
341 switch (topLevelType) {
342 case topLevelTypes.topCompositionEnd:
343 return getDataFromCustomEvent(nativeEvent);
344 case topLevelTypes.topKeyPress:
345 /**
346 * If native `textInput` events are available, our goal is to make
347 * use of them. However, there is a special case: the spacebar key.
348 * In Webkit, preventing default on a spacebar `textInput` event
349 * cancels character insertion, but it *also* causes the browser
350 * to fall back to its default spacebar behavior of scrolling the
351 * page.
352 *
353 * Tracking at:
354 * https://code.google.com/p/chromium/issues/detail?id=355103
355 *
356 * To avoid this issue, use the keypress event as if no `textInput`
357 * event is available.
358 */
359 var which = nativeEvent.which;
360 if (which !== SPACEBAR_CODE) {
361 return null;
362 }
363
364 hasSpaceKeypress = true;
365 return SPACEBAR_CHAR;
366
367 case topLevelTypes.topTextInput:
368 // Record the characters to be added to the DOM.
369 var chars = nativeEvent.data;
370
371 // If it's a spacebar character, assume that we have already handled
372 // it at the keypress level and bail immediately. Android Chrome
373 // doesn't give us keycodes, so we need to blacklist it.
374 if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
375 return null;
376 }
377
378 return chars;
379
380 default:
381 // For other native event types, do nothing.
382 return null;
383 }
384}
385
386/**
387 * For browsers that do not provide the `textInput` event, extract the
388 * appropriate string to use for SyntheticInputEvent.
389 *
390 * @param {string} topLevelType Record from `EventConstants`.
391 * @param {object} nativeEvent Native browser event.
392 * @return {?string} The fallback string for this `beforeInput` event.
393 */
394function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
395 // If we are currently composing (IME) and using a fallback to do so,
396 // try to extract the composed characters from the fallback object.
397 if (currentComposition) {
398 if (topLevelType === topLevelTypes.topCompositionEnd || isFallbackCompositionEnd(topLevelType, nativeEvent)) {
399 var chars = currentComposition.getData();
400 FallbackCompositionState.release(currentComposition);
401 currentComposition = null;
402 return chars;
403 }
404 return null;
405 }
406
407 switch (topLevelType) {
408 case topLevelTypes.topPaste:
409 // If a paste event occurs after a keypress, throw out the input
410 // chars. Paste events should not lead to BeforeInput events.
411 return null;
412 case topLevelTypes.topKeyPress:
413 /**
414 * As of v27, Firefox may fire keypress events even when no character
415 * will be inserted. A few possibilities:
416 *
417 * - `which` is `0`. Arrow keys, Esc key, etc.
418 *
419 * - `which` is the pressed key code, but no char is available.
420 * Ex: 'AltGr + d` in Polish. There is no modified character for
421 * this key combination and no character is inserted into the
422 * document, but FF fires the keypress for char code `100` anyway.
423 * No `input` event will occur.
424 *
425 * - `which` is the pressed key code, but a command combination is
426 * being used. Ex: `Cmd+C`. No character is inserted, and no
427 * `input` event will occur.
428 */
429 if (nativeEvent.which && !isKeypressCommand(nativeEvent)) {
430 return String.fromCharCode(nativeEvent.which);
431 }
432 return null;
433 case topLevelTypes.topCompositionEnd:
434 return useFallbackCompositionData ? null : nativeEvent.data;
435 default:
436 return null;
437 }
438}
439
440/**
441 * Extract a SyntheticInputEvent for `beforeInput`, based on either native
442 * `textInput` or fallback behavior.
443 *
444 * @param {string} topLevelType Record from `EventConstants`.
445 * @param {DOMEventTarget} topLevelTarget The listening component root node.
446 * @param {string} topLevelTargetID ID of `topLevelTarget`.
447 * @param {object} nativeEvent Native browser event.
448 * @return {?object} A SyntheticInputEvent.
449 */
450function extractBeforeInputEvent(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
451 var chars;
452
453 if (canUseTextInputEvent) {
454 chars = getNativeBeforeInputChars(topLevelType, nativeEvent);
455 } else {
456 chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);
457 }
458
459 // If no characters are being inserted, no BeforeInput event should
460 // be fired.
461 if (!chars) {
462 return null;
463 }
464
465 var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, topLevelTargetID, nativeEvent, nativeEventTarget);
466
467 event.data = chars;
468 EventPropagators.accumulateTwoPhaseDispatches(event);
469 return event;
470}
471
472/**
473 * Create an `onBeforeInput` event to match
474 * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.
475 *
476 * This event plugin is based on the native `textInput` event
477 * available in Chrome, Safari, Opera, and IE. This event fires after
478 * `onKeyPress` and `onCompositionEnd`, but before `onInput`.
479 *
480 * `beforeInput` is spec'd but not implemented in any browsers, and
481 * the `input` event does not provide any useful information about what has
482 * actually been added, contrary to the spec. Thus, `textInput` is the best
483 * available event to identify the characters that have actually been inserted
484 * into the target node.
485 *
486 * This plugin is also responsible for emitting `composition` events, thus
487 * allowing us to share composition fallback code for both `beforeInput` and
488 * `composition` event types.
489 */
490var BeforeInputEventPlugin = {
491
492 eventTypes: eventTypes,
493
494 /**
495 * @param {string} topLevelType Record from `EventConstants`.
496 * @param {DOMEventTarget} topLevelTarget The listening component root node.
497 * @param {string} topLevelTargetID ID of `topLevelTarget`.
498 * @param {object} nativeEvent Native browser event.
499 * @return {*} An accumulation of synthetic events.
500 * @see {EventPluginHub.extractEvents}
501 */
502 extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
503 return [extractCompositionEvent(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget), extractBeforeInputEvent(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget)];
504 }
505};
506
507module.exports = BeforeInputEventPlugin;
508},{"103":103,"107":107,"147":147,"15":15,"166":166,"19":19,"20":20}],4:[function(_dereq_,module,exports){
509/**
510 * Copyright 2013-2015, Facebook, Inc.
511 * All rights reserved.
512 *
513 * This source code is licensed under the BSD-style license found in the
514 * LICENSE file in the root directory of this source tree. An additional grant
515 * of patent rights can be found in the PATENTS file in the same directory.
516 *
517 * @providesModule CSSProperty
518 */
519
520'use strict';
521
522/**
523 * CSS properties which accept numbers but are not in units of "px".
524 */
525var isUnitlessNumber = {
526 animationIterationCount: true,
527 boxFlex: true,
528 boxFlexGroup: true,
529 boxOrdinalGroup: true,
530 columnCount: true,
531 flex: true,
532 flexGrow: true,
533 flexPositive: true,
534 flexShrink: true,
535 flexNegative: true,
536 flexOrder: true,
537 fontWeight: true,
538 lineClamp: true,
539 lineHeight: true,
540 opacity: true,
541 order: true,
542 orphans: true,
543 tabSize: true,
544 widows: true,
545 zIndex: true,
546 zoom: true,
547
548 // SVG-related properties
549 fillOpacity: true,
550 stopOpacity: true,
551 strokeDashoffset: true,
552 strokeOpacity: true,
553 strokeWidth: true
554};
555
556/**
557 * @param {string} prefix vendor-specific prefix, eg: Webkit
558 * @param {string} key style name, eg: transitionDuration
559 * @return {string} style name prefixed with `prefix`, properly camelCased, eg:
560 * WebkitTransitionDuration
561 */
562function prefixKey(prefix, key) {
563 return prefix + key.charAt(0).toUpperCase() + key.substring(1);
564}
565
566/**
567 * Support style names that may come passed in prefixed by adding permutations
568 * of vendor prefixes.
569 */
570var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
571
572// Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
573// infinite loop, because it iterates over the newly added props too.
574Object.keys(isUnitlessNumber).forEach(function (prop) {
575 prefixes.forEach(function (prefix) {
576 isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
577 });
578});
579
580/**
581 * Most style properties can be unset by doing .style[prop] = '' but IE8
582 * doesn't like doing that with shorthand properties so for the properties that
583 * IE8 breaks on, which are listed here, we instead unset each of the
584 * individual properties. See http://bugs.jquery.com/ticket/12385.
585 * The 4-value 'clock' properties like margin, padding, border-width seem to
586 * behave without any problems. Curiously, list-style works too without any
587 * special prodding.
588 */
589var shorthandPropertyExpansions = {
590 background: {
591 backgroundAttachment: true,
592 backgroundColor: true,
593 backgroundImage: true,
594 backgroundPositionX: true,
595 backgroundPositionY: true,
596 backgroundRepeat: true
597 },
598 backgroundPosition: {
599 backgroundPositionX: true,
600 backgroundPositionY: true
601 },
602 border: {
603 borderWidth: true,
604 borderStyle: true,
605 borderColor: true
606 },
607 borderBottom: {
608 borderBottomWidth: true,
609 borderBottomStyle: true,
610 borderBottomColor: true
611 },
612 borderLeft: {
613 borderLeftWidth: true,
614 borderLeftStyle: true,
615 borderLeftColor: true
616 },
617 borderRight: {
618 borderRightWidth: true,
619 borderRightStyle: true,
620 borderRightColor: true
621 },
622 borderTop: {
623 borderTopWidth: true,
624 borderTopStyle: true,
625 borderTopColor: true
626 },
627 font: {
628 fontStyle: true,
629 fontVariant: true,
630 fontWeight: true,
631 fontSize: true,
632 lineHeight: true,
633 fontFamily: true
634 },
635 outline: {
636 outlineWidth: true,
637 outlineStyle: true,
638 outlineColor: true
639 }
640};
641
642var CSSProperty = {
643 isUnitlessNumber: isUnitlessNumber,
644 shorthandPropertyExpansions: shorthandPropertyExpansions
645};
646
647module.exports = CSSProperty;
648},{}],5:[function(_dereq_,module,exports){
649/**
650 * Copyright 2013-2015, Facebook, Inc.
651 * All rights reserved.
652 *
653 * This source code is licensed under the BSD-style license found in the
654 * LICENSE file in the root directory of this source tree. An additional grant
655 * of patent rights can be found in the PATENTS file in the same directory.
656 *
657 * @providesModule CSSPropertyOperations
658 * @typechecks static-only
659 */
660
661'use strict';
662
663var CSSProperty = _dereq_(4);
664var ExecutionEnvironment = _dereq_(147);
665var ReactPerf = _dereq_(78);
666
667var camelizeStyleName = _dereq_(149);
668var dangerousStyleValue = _dereq_(119);
669var hyphenateStyleName = _dereq_(160);
670var memoizeStringOnly = _dereq_(168);
671var warning = _dereq_(173);
672
673var processStyleName = memoizeStringOnly(function (styleName) {
674 return hyphenateStyleName(styleName);
675});
676
677var hasShorthandPropertyBug = false;
678var styleFloatAccessor = 'cssFloat';
679if (ExecutionEnvironment.canUseDOM) {
680 var tempStyle = document.createElement('div').style;
681 try {
682 // IE8 throws "Invalid argument." if resetting shorthand style properties.
683 tempStyle.font = '';
684 } catch (e) {
685 hasShorthandPropertyBug = true;
686 }
687 // IE8 only supports accessing cssFloat (standard) as styleFloat
688 if (document.documentElement.style.cssFloat === undefined) {
689 styleFloatAccessor = 'styleFloat';
690 }
691}
692
693if ("development" !== 'production') {
694 // 'msTransform' is correct, but the other prefixes should be capitalized
695 var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
696
697 // style values shouldn't contain a semicolon
698 var badStyleValueWithSemicolonPattern = /;\s*$/;
699
700 var warnedStyleNames = {};
701 var warnedStyleValues = {};
702
703 var warnHyphenatedStyleName = function (name) {
704 if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
705 return;
706 }
707
708 warnedStyleNames[name] = true;
709 "development" !== 'production' ? warning(false, 'Unsupported style property %s. Did you mean %s?', name, camelizeStyleName(name)) : undefined;
710 };
711
712 var warnBadVendoredStyleName = function (name) {
713 if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
714 return;
715 }
716
717 warnedStyleNames[name] = true;
718 "development" !== 'production' ? warning(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1)) : undefined;
719 };
720
721 var warnStyleValueWithSemicolon = function (name, value) {
722 if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
723 return;
724 }
725
726 warnedStyleValues[value] = true;
727 "development" !== 'production' ? warning(false, 'Style property values shouldn\'t contain a semicolon. ' + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, '')) : undefined;
728 };
729
730 /**
731 * @param {string} name
732 * @param {*} value
733 */
734 var warnValidStyle = function (name, value) {
735 if (name.indexOf('-') > -1) {
736 warnHyphenatedStyleName(name);
737 } else if (badVendoredStyleNamePattern.test(name)) {
738 warnBadVendoredStyleName(name);
739 } else if (badStyleValueWithSemicolonPattern.test(value)) {
740 warnStyleValueWithSemicolon(name, value);
741 }
742 };
743}
744
745/**
746 * Operations for dealing with CSS properties.
747 */
748var CSSPropertyOperations = {
749
750 /**
751 * Serializes a mapping of style properties for use as inline styles:
752 *
753 * > createMarkupForStyles({width: '200px', height: 0})
754 * "width:200px;height:0;"
755 *
756 * Undefined values are ignored so that declarative programming is easier.
757 * The result should be HTML-escaped before insertion into the DOM.
758 *
759 * @param {object} styles
760 * @return {?string}
761 */
762 createMarkupForStyles: function (styles) {
763 var serialized = '';
764 for (var styleName in styles) {
765 if (!styles.hasOwnProperty(styleName)) {
766 continue;
767 }
768 var styleValue = styles[styleName];
769 if ("development" !== 'production') {
770 warnValidStyle(styleName, styleValue);
771 }
772 if (styleValue != null) {
773 serialized += processStyleName(styleName) + ':';
774 serialized += dangerousStyleValue(styleName, styleValue) + ';';
775 }
776 }
777 return serialized || null;
778 },
779
780 /**
781 * Sets the value for multiple styles on a node. If a value is specified as
782 * '' (empty string), the corresponding style property will be unset.
783 *
784 * @param {DOMElement} node
785 * @param {object} styles
786 */
787 setValueForStyles: function (node, styles) {
788 var style = node.style;
789 for (var styleName in styles) {
790 if (!styles.hasOwnProperty(styleName)) {
791 continue;
792 }
793 if ("development" !== 'production') {
794 warnValidStyle(styleName, styles[styleName]);
795 }
796 var styleValue = dangerousStyleValue(styleName, styles[styleName]);
797 if (styleName === 'float') {
798 styleName = styleFloatAccessor;
799 }
800 if (styleValue) {
801 style[styleName] = styleValue;
802 } else {
803 var expansion = hasShorthandPropertyBug && CSSProperty.shorthandPropertyExpansions[styleName];
804 if (expansion) {
805 // Shorthand property that IE8 won't like unsetting, so unset each
806 // component to placate it
807 for (var individualStyleName in expansion) {
808 style[individualStyleName] = '';
809 }
810 } else {
811 style[styleName] = '';
812 }
813 }
814 }
815 }
816
817};
818
819ReactPerf.measureMethods(CSSPropertyOperations, 'CSSPropertyOperations', {
820 setValueForStyles: 'setValueForStyles'
821});
822
823module.exports = CSSPropertyOperations;
824},{"119":119,"147":147,"149":149,"160":160,"168":168,"173":173,"4":4,"78":78}],6:[function(_dereq_,module,exports){
825/**
826 * Copyright 2013-2015, Facebook, Inc.
827 * All rights reserved.
828 *
829 * This source code is licensed under the BSD-style license found in the
830 * LICENSE file in the root directory of this source tree. An additional grant
831 * of patent rights can be found in the PATENTS file in the same directory.
832 *
833 * @providesModule CallbackQueue
834 */
835
836'use strict';
837
838var PooledClass = _dereq_(25);
839
840var assign = _dereq_(24);
841var invariant = _dereq_(161);
842
843/**
844 * A specialized pseudo-event module to help keep track of components waiting to
845 * be notified when their DOM representations are available for use.
846 *
847 * This implements `PooledClass`, so you should never need to instantiate this.
848 * Instead, use `CallbackQueue.getPooled()`.
849 *
850 * @class ReactMountReady
851 * @implements PooledClass
852 * @internal
853 */
854function CallbackQueue() {
855 this._callbacks = null;
856 this._contexts = null;
857}
858
859assign(CallbackQueue.prototype, {
860
861 /**
862 * Enqueues a callback to be invoked when `notifyAll` is invoked.
863 *
864 * @param {function} callback Invoked when `notifyAll` is invoked.
865 * @param {?object} context Context to call `callback` with.
866 * @internal
867 */
868 enqueue: function (callback, context) {
869 this._callbacks = this._callbacks || [];
870 this._contexts = this._contexts || [];
871 this._callbacks.push(callback);
872 this._contexts.push(context);
873 },
874
875 /**
876 * Invokes all enqueued callbacks and clears the queue. This is invoked after
877 * the DOM representation of a component has been created or updated.
878 *
879 * @internal
880 */
881 notifyAll: function () {
882 var callbacks = this._callbacks;
883 var contexts = this._contexts;
884 if (callbacks) {
885 !(callbacks.length === contexts.length) ? "development" !== 'production' ? invariant(false, 'Mismatched list of contexts in callback queue') : invariant(false) : undefined;
886 this._callbacks = null;
887 this._contexts = null;
888 for (var i = 0; i < callbacks.length; i++) {
889 callbacks[i].call(contexts[i]);
890 }
891 callbacks.length = 0;
892 contexts.length = 0;
893 }
894 },
895
896 /**
897 * Resets the internal queue.
898 *
899 * @internal
900 */
901 reset: function () {
902 this._callbacks = null;
903 this._contexts = null;
904 },
905
906 /**
907 * `PooledClass` looks for this.
908 */
909 destructor: function () {
910 this.reset();
911 }
912
913});
914
915PooledClass.addPoolingTo(CallbackQueue);
916
917module.exports = CallbackQueue;
918},{"161":161,"24":24,"25":25}],7:[function(_dereq_,module,exports){
919/**
920 * Copyright 2013-2015, Facebook, Inc.
921 * All rights reserved.
922 *
923 * This source code is licensed under the BSD-style license found in the
924 * LICENSE file in the root directory of this source tree. An additional grant
925 * of patent rights can be found in the PATENTS file in the same directory.
926 *
927 * @providesModule ChangeEventPlugin
928 */
929
930'use strict';
931
932var EventConstants = _dereq_(15);
933var EventPluginHub = _dereq_(16);
934var EventPropagators = _dereq_(19);
935var ExecutionEnvironment = _dereq_(147);
936var ReactUpdates = _dereq_(96);
937var SyntheticEvent = _dereq_(105);
938
939var getEventTarget = _dereq_(128);
940var isEventSupported = _dereq_(133);
941var isTextInputElement = _dereq_(134);
942var keyOf = _dereq_(166);
943
944var topLevelTypes = EventConstants.topLevelTypes;
945
946var eventTypes = {
947 change: {
948 phasedRegistrationNames: {
949 bubbled: keyOf({ onChange: null }),
950 captured: keyOf({ onChangeCapture: null })
951 },
952 dependencies: [topLevelTypes.topBlur, topLevelTypes.topChange, topLevelTypes.topClick, topLevelTypes.topFocus, topLevelTypes.topInput, topLevelTypes.topKeyDown, topLevelTypes.topKeyUp, topLevelTypes.topSelectionChange]
953 }
954};
955
956/**
957 * For IE shims
958 */
959var activeElement = null;
960var activeElementID = null;
961var activeElementValue = null;
962var activeElementValueProp = null;
963
964/**
965 * SECTION: handle `change` event
966 */
967function shouldUseChangeEvent(elem) {
968 var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
969 return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
970}
971
972var doesChangeEventBubble = false;
973if (ExecutionEnvironment.canUseDOM) {
974 // See `handleChange` comment below
975 doesChangeEventBubble = isEventSupported('change') && (!('documentMode' in document) || document.documentMode > 8);
976}
977
978function manualDispatchChangeEvent(nativeEvent) {
979 var event = SyntheticEvent.getPooled(eventTypes.change, activeElementID, nativeEvent, getEventTarget(nativeEvent));
980 EventPropagators.accumulateTwoPhaseDispatches(event);
981
982 // If change and propertychange bubbled, we'd just bind to it like all the
983 // other events and have it go through ReactBrowserEventEmitter. Since it
984 // doesn't, we manually listen for the events and so we have to enqueue and
985 // process the abstract event manually.
986 //
987 // Batching is necessary here in order to ensure that all event handlers run
988 // before the next rerender (including event handlers attached to ancestor
989 // elements instead of directly on the input). Without this, controlled
990 // components don't work properly in conjunction with event bubbling because
991 // the component is rerendered and the value reverted before all the event
992 // handlers can run. See https://github.com/facebook/react/issues/708.
993 ReactUpdates.batchedUpdates(runEventInBatch, event);
994}
995
996function runEventInBatch(event) {
997 EventPluginHub.enqueueEvents(event);
998 EventPluginHub.processEventQueue(false);
999}
1000
1001function startWatchingForChangeEventIE8(target, targetID) {
1002 activeElement = target;
1003 activeElementID = targetID;
1004 activeElement.attachEvent('onchange', manualDispatchChangeEvent);
1005}
1006
1007function stopWatchingForChangeEventIE8() {
1008 if (!activeElement) {
1009 return;
1010 }
1011 activeElement.detachEvent('onchange', manualDispatchChangeEvent);
1012 activeElement = null;
1013 activeElementID = null;
1014}
1015
1016function getTargetIDForChangeEvent(topLevelType, topLevelTarget, topLevelTargetID) {
1017 if (topLevelType === topLevelTypes.topChange) {
1018 return topLevelTargetID;
1019 }
1020}
1021function handleEventsForChangeEventIE8(topLevelType, topLevelTarget, topLevelTargetID) {
1022 if (topLevelType === topLevelTypes.topFocus) {
1023 // stopWatching() should be a noop here but we call it just in case we
1024 // missed a blur event somehow.
1025 stopWatchingForChangeEventIE8();
1026 startWatchingForChangeEventIE8(topLevelTarget, topLevelTargetID);
1027 } else if (topLevelType === topLevelTypes.topBlur) {
1028 stopWatchingForChangeEventIE8();
1029 }
1030}
1031
1032/**
1033 * SECTION: handle `input` event
1034 */
1035var isInputEventSupported = false;
1036if (ExecutionEnvironment.canUseDOM) {
1037 // IE9 claims to support the input event but fails to trigger it when
1038 // deleting text, so we ignore its input events
1039 isInputEventSupported = isEventSupported('input') && (!('documentMode' in document) || document.documentMode > 9);
1040}
1041
1042/**
1043 * (For old IE.) Replacement getter/setter for the `value` property that gets
1044 * set on the active element.
1045 */
1046var newValueProp = {
1047 get: function () {
1048 return activeElementValueProp.get.call(this);
1049 },
1050 set: function (val) {
1051 // Cast to a string so we can do equality checks.
1052 activeElementValue = '' + val;
1053 activeElementValueProp.set.call(this, val);
1054 }
1055};
1056
1057/**
1058 * (For old IE.) Starts tracking propertychange events on the passed-in element
1059 * and override the value property so that we can distinguish user events from
1060 * value changes in JS.
1061 */
1062function startWatchingForValueChange(target, targetID) {
1063 activeElement = target;
1064 activeElementID = targetID;
1065 activeElementValue = target.value;
1066 activeElementValueProp = Object.getOwnPropertyDescriptor(target.constructor.prototype, 'value');
1067
1068 // Not guarded in a canDefineProperty check: IE8 supports defineProperty only
1069 // on DOM elements
1070 Object.defineProperty(activeElement, 'value', newValueProp);
1071 activeElement.attachEvent('onpropertychange', handlePropertyChange);
1072}
1073
1074/**
1075 * (For old IE.) Removes the event listeners from the currently-tracked element,
1076 * if any exists.
1077 */
1078function stopWatchingForValueChange() {
1079 if (!activeElement) {
1080 return;
1081 }
1082
1083 // delete restores the original property definition
1084 delete activeElement.value;
1085 activeElement.detachEvent('onpropertychange', handlePropertyChange);
1086
1087 activeElement = null;
1088 activeElementID = null;
1089 activeElementValue = null;
1090 activeElementValueProp = null;
1091}
1092
1093/**
1094 * (For old IE.) Handles a propertychange event, sending a `change` event if
1095 * the value of the active element has changed.
1096 */
1097function handlePropertyChange(nativeEvent) {
1098 if (nativeEvent.propertyName !== 'value') {
1099 return;
1100 }
1101 var value = nativeEvent.srcElement.value;
1102 if (value === activeElementValue) {
1103 return;
1104 }
1105 activeElementValue = value;
1106
1107 manualDispatchChangeEvent(nativeEvent);
1108}
1109
1110/**
1111 * If a `change` event should be fired, returns the target's ID.
1112 */
1113function getTargetIDForInputEvent(topLevelType, topLevelTarget, topLevelTargetID) {
1114 if (topLevelType === topLevelTypes.topInput) {
1115 // In modern browsers (i.e., not IE8 or IE9), the input event is exactly
1116 // what we want so fall through here and trigger an abstract event
1117 return topLevelTargetID;
1118 }
1119}
1120
1121// For IE8 and IE9.
1122function handleEventsForInputEventIE(topLevelType, topLevelTarget, topLevelTargetID) {
1123 if (topLevelType === topLevelTypes.topFocus) {
1124 // In IE8, we can capture almost all .value changes by adding a
1125 // propertychange handler and looking for events with propertyName
1126 // equal to 'value'
1127 // In IE9, propertychange fires for most input events but is buggy and
1128 // doesn't fire when text is deleted, but conveniently, selectionchange
1129 // appears to fire in all of the remaining cases so we catch those and
1130 // forward the event if the value has changed
1131 // In either case, we don't want to call the event handler if the value
1132 // is changed from JS so we redefine a setter for `.value` that updates
1133 // our activeElementValue variable, allowing us to ignore those changes
1134 //
1135 // stopWatching() should be a noop here but we call it just in case we
1136 // missed a blur event somehow.
1137 stopWatchingForValueChange();
1138 startWatchingForValueChange(topLevelTarget, topLevelTargetID);
1139 } else if (topLevelType === topLevelTypes.topBlur) {
1140 stopWatchingForValueChange();
1141 }
1142}
1143
1144// For IE8 and IE9.
1145function getTargetIDForInputEventIE(topLevelType, topLevelTarget, topLevelTargetID) {
1146 if (topLevelType === topLevelTypes.topSelectionChange || topLevelType === topLevelTypes.topKeyUp || topLevelType === topLevelTypes.topKeyDown) {
1147 // On the selectionchange event, the target is just document which isn't
1148 // helpful for us so just check activeElement instead.
1149 //
1150 // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
1151 // propertychange on the first input event after setting `value` from a
1152 // script and fires only keydown, keypress, keyup. Catching keyup usually
1153 // gets it and catching keydown lets us fire an event for the first
1154 // keystroke if user does a key repeat (it'll be a little delayed: right
1155 // before the second keystroke). Other input methods (e.g., paste) seem to
1156 // fire selectionchange normally.
1157 if (activeElement && activeElement.value !== activeElementValue) {
1158 activeElementValue = activeElement.value;
1159 return activeElementID;
1160 }
1161 }
1162}
1163
1164/**
1165 * SECTION: handle `click` event
1166 */
1167function shouldUseClickEvent(elem) {
1168 // Use the `click` event to detect changes to checkbox and radio inputs.
1169 // This approach works across all browsers, whereas `change` does not fire
1170 // until `blur` in IE8.
1171 return elem.nodeName && elem.nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
1172}
1173
1174function getTargetIDForClickEvent(topLevelType, topLevelTarget, topLevelTargetID) {
1175 if (topLevelType === topLevelTypes.topClick) {
1176 return topLevelTargetID;
1177 }
1178}
1179
1180/**
1181 * This plugin creates an `onChange` event that normalizes change events
1182 * across form elements. This event fires at a time when it's possible to
1183 * change the element's value without seeing a flicker.
1184 *
1185 * Supported elements are:
1186 * - input (see `isTextInputElement`)
1187 * - textarea
1188 * - select
1189 */
1190var ChangeEventPlugin = {
1191
1192 eventTypes: eventTypes,
1193
1194 /**
1195 * @param {string} topLevelType Record from `EventConstants`.
1196 * @param {DOMEventTarget} topLevelTarget The listening component root node.
1197 * @param {string} topLevelTargetID ID of `topLevelTarget`.
1198 * @param {object} nativeEvent Native browser event.
1199 * @return {*} An accumulation of synthetic events.
1200 * @see {EventPluginHub.extractEvents}
1201 */
1202 extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
1203
1204 var getTargetIDFunc, handleEventFunc;
1205 if (shouldUseChangeEvent(topLevelTarget)) {
1206 if (doesChangeEventBubble) {
1207 getTargetIDFunc = getTargetIDForChangeEvent;
1208 } else {
1209 handleEventFunc = handleEventsForChangeEventIE8;
1210 }
1211 } else if (isTextInputElement(topLevelTarget)) {
1212 if (isInputEventSupported) {
1213 getTargetIDFunc = getTargetIDForInputEvent;
1214 } else {
1215 getTargetIDFunc = getTargetIDForInputEventIE;
1216 handleEventFunc = handleEventsForInputEventIE;
1217 }
1218 } else if (shouldUseClickEvent(topLevelTarget)) {
1219 getTargetIDFunc = getTargetIDForClickEvent;
1220 }
1221
1222 if (getTargetIDFunc) {
1223 var targetID = getTargetIDFunc(topLevelType, topLevelTarget, topLevelTargetID);
1224 if (targetID) {
1225 var event = SyntheticEvent.getPooled(eventTypes.change, targetID, nativeEvent, nativeEventTarget);
1226 event.type = 'change';
1227 EventPropagators.accumulateTwoPhaseDispatches(event);
1228 return event;
1229 }
1230 }
1231
1232 if (handleEventFunc) {
1233 handleEventFunc(topLevelType, topLevelTarget, topLevelTargetID);
1234 }
1235 }
1236
1237};
1238
1239module.exports = ChangeEventPlugin;
1240},{"105":105,"128":128,"133":133,"134":134,"147":147,"15":15,"16":16,"166":166,"19":19,"96":96}],8:[function(_dereq_,module,exports){
1241/**
1242 * Copyright 2013-2015, Facebook, Inc.
1243 * All rights reserved.
1244 *
1245 * This source code is licensed under the BSD-style license found in the
1246 * LICENSE file in the root directory of this source tree. An additional grant
1247 * of patent rights can be found in the PATENTS file in the same directory.
1248 *
1249 * @providesModule ClientReactRootIndex
1250 * @typechecks
1251 */
1252
1253'use strict';
1254
1255var nextReactRootIndex = 0;
1256
1257var ClientReactRootIndex = {
1258 createReactRootIndex: function () {
1259 return nextReactRootIndex++;
1260 }
1261};
1262
1263module.exports = ClientReactRootIndex;
1264},{}],9:[function(_dereq_,module,exports){
1265/**
1266 * Copyright 2013-2015, Facebook, Inc.
1267 * All rights reserved.
1268 *
1269 * This source code is licensed under the BSD-style license found in the
1270 * LICENSE file in the root directory of this source tree. An additional grant
1271 * of patent rights can be found in the PATENTS file in the same directory.
1272 *
1273 * @providesModule DOMChildrenOperations
1274 * @typechecks static-only
1275 */
1276
1277'use strict';
1278
1279var Danger = _dereq_(12);
1280var ReactMultiChildUpdateTypes = _dereq_(74);
1281var ReactPerf = _dereq_(78);
1282
1283var setInnerHTML = _dereq_(138);
1284var setTextContent = _dereq_(139);
1285var invariant = _dereq_(161);
1286
1287/**
1288 * Inserts `childNode` as a child of `parentNode` at the `index`.
1289 *
1290 * @param {DOMElement} parentNode Parent node in which to insert.
1291 * @param {DOMElement} childNode Child node to insert.
1292 * @param {number} index Index at which to insert the child.
1293 * @internal
1294 */
1295function insertChildAt(parentNode, childNode, index) {
1296 // By exploiting arrays returning `undefined` for an undefined index, we can
1297 // rely exclusively on `insertBefore(node, null)` instead of also using
1298 // `appendChild(node)`. However, using `undefined` is not allowed by all
1299 // browsers so we must replace it with `null`.
1300
1301 // fix render order error in safari
1302 // IE8 will throw error when index out of list size.
1303 var beforeChild = index >= parentNode.childNodes.length ? null : parentNode.childNodes.item(index);
1304
1305 parentNode.insertBefore(childNode, beforeChild);
1306}
1307
1308/**
1309 * Operations for updating with DOM children.
1310 */
1311var DOMChildrenOperations = {
1312
1313 dangerouslyReplaceNodeWithMarkup: Danger.dangerouslyReplaceNodeWithMarkup,
1314
1315 updateTextContent: setTextContent,
1316
1317 /**
1318 * Updates a component's children by processing a series of updates. The
1319 * update configurations are each expected to have a `parentNode` property.
1320 *
1321 * @param {array<object>} updates List of update configurations.
1322 * @param {array<string>} markupList List of markup strings.
1323 * @internal
1324 */
1325 processUpdates: function (updates, markupList) {
1326 var update;
1327 // Mapping from parent IDs to initial child orderings.
1328 var initialChildren = null;
1329 // List of children that will be moved or removed.
1330 var updatedChildren = null;
1331
1332 for (var i = 0; i < updates.length; i++) {
1333 update = updates[i];
1334 if (update.type === ReactMultiChildUpdateTypes.MOVE_EXISTING || update.type === ReactMultiChildUpdateTypes.REMOVE_NODE) {
1335 var updatedIndex = update.fromIndex;
1336 var updatedChild = update.parentNode.childNodes[updatedIndex];
1337 var parentID = update.parentID;
1338
1339 !updatedChild ? "development" !== 'production' ? invariant(false, 'processUpdates(): Unable to find child %s of element. This ' + 'probably means the DOM was unexpectedly mutated (e.g., by the ' + 'browser), usually due to forgetting a <tbody> when using tables, ' + 'nesting tags like <form>, <p>, or <a>, or using non-SVG elements ' + 'in an <svg> parent. Try inspecting the child nodes of the element ' + 'with React ID `%s`.', updatedIndex, parentID) : invariant(false) : undefined;
1340
1341 initialChildren = initialChildren || {};
1342 initialChildren[parentID] = initialChildren[parentID] || [];
1343 initialChildren[parentID][updatedIndex] = updatedChild;
1344
1345 updatedChildren = updatedChildren || [];
1346 updatedChildren.push(updatedChild);
1347 }
1348 }
1349
1350 var renderedMarkup;
1351 // markupList is either a list of markup or just a list of elements
1352 if (markupList.length && typeof markupList[0] === 'string') {
1353 renderedMarkup = Danger.dangerouslyRenderMarkup(markupList);
1354 } else {
1355 renderedMarkup = markupList;
1356 }
1357
1358 // Remove updated children first so that `toIndex` is consistent.
1359 if (updatedChildren) {
1360 for (var j = 0; j < updatedChildren.length; j++) {
1361 updatedChildren[j].parentNode.removeChild(updatedChildren[j]);
1362 }
1363 }
1364
1365 for (var k = 0; k < updates.length; k++) {
1366 update = updates[k];
1367 switch (update.type) {
1368 case ReactMultiChildUpdateTypes.INSERT_MARKUP:
1369 insertChildAt(update.parentNode, renderedMarkup[update.markupIndex], update.toIndex);
1370 break;
1371 case ReactMultiChildUpdateTypes.MOVE_EXISTING:
1372 insertChildAt(update.parentNode, initialChildren[update.parentID][update.fromIndex], update.toIndex);
1373 break;
1374 case ReactMultiChildUpdateTypes.SET_MARKUP:
1375 setInnerHTML(update.parentNode, update.content);
1376 break;
1377 case ReactMultiChildUpdateTypes.TEXT_CONTENT:
1378 setTextContent(update.parentNode, update.content);
1379 break;
1380 case ReactMultiChildUpdateTypes.REMOVE_NODE:
1381 // Already removed by the for-loop above.
1382 break;
1383 }
1384 }
1385 }
1386
1387};
1388
1389ReactPerf.measureMethods(DOMChildrenOperations, 'DOMChildrenOperations', {
1390 updateTextContent: 'updateTextContent'
1391});
1392
1393module.exports = DOMChildrenOperations;
1394},{"12":12,"138":138,"139":139,"161":161,"74":74,"78":78}],10:[function(_dereq_,module,exports){
1395/**
1396 * Copyright 2013-2015, Facebook, Inc.
1397 * All rights reserved.
1398 *
1399 * This source code is licensed under the BSD-style license found in the
1400 * LICENSE file in the root directory of this source tree. An additional grant
1401 * of patent rights can be found in the PATENTS file in the same directory.
1402 *
1403 * @providesModule DOMProperty
1404 * @typechecks static-only
1405 */
1406
1407'use strict';
1408
1409var invariant = _dereq_(161);
1410
1411function checkMask(value, bitmask) {
1412 return (value & bitmask) === bitmask;
1413}
1414
1415var DOMPropertyInjection = {
1416 /**
1417 * Mapping from normalized, camelcased property names to a configuration that
1418 * specifies how the associated DOM property should be accessed or rendered.
1419 */
1420 MUST_USE_ATTRIBUTE: 0x1,
1421 MUST_USE_PROPERTY: 0x2,
1422 HAS_SIDE_EFFECTS: 0x4,
1423 HAS_BOOLEAN_VALUE: 0x8,
1424 HAS_NUMERIC_VALUE: 0x10,
1425 HAS_POSITIVE_NUMERIC_VALUE: 0x20 | 0x10,
1426 HAS_OVERLOADED_BOOLEAN_VALUE: 0x40,
1427
1428 /**
1429 * Inject some specialized knowledge about the DOM. This takes a config object
1430 * with the following properties:
1431 *
1432 * isCustomAttribute: function that given an attribute name will return true
1433 * if it can be inserted into the DOM verbatim. Useful for data-* or aria-*
1434 * attributes where it's impossible to enumerate all of the possible
1435 * attribute names,
1436 *
1437 * Properties: object mapping DOM property name to one of the
1438 * DOMPropertyInjection constants or null. If your attribute isn't in here,
1439 * it won't get written to the DOM.
1440 *
1441 * DOMAttributeNames: object mapping React attribute name to the DOM
1442 * attribute name. Attribute names not specified use the **lowercase**
1443 * normalized name.
1444 *
1445 * DOMAttributeNamespaces: object mapping React attribute name to the DOM
1446 * attribute namespace URL. (Attribute names not specified use no namespace.)
1447 *
1448 * DOMPropertyNames: similar to DOMAttributeNames but for DOM properties.
1449 * Property names not specified use the normalized name.
1450 *
1451 * DOMMutationMethods: Properties that require special mutation methods. If
1452 * `value` is undefined, the mutation method should unset the property.
1453 *
1454 * @param {object} domPropertyConfig the config as described above.
1455 */
1456 injectDOMPropertyConfig: function (domPropertyConfig) {
1457 var Injection = DOMPropertyInjection;
1458 var Properties = domPropertyConfig.Properties || {};
1459 var DOMAttributeNamespaces = domPropertyConfig.DOMAttributeNamespaces || {};
1460 var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {};
1461 var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {};
1462 var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {};
1463
1464 if (domPropertyConfig.isCustomAttribute) {
1465 DOMProperty._isCustomAttributeFunctions.push(domPropertyConfig.isCustomAttribute);
1466 }
1467
1468 for (var propName in Properties) {
1469 !!DOMProperty.properties.hasOwnProperty(propName) ? "development" !== 'production' ? invariant(false, 'injectDOMPropertyConfig(...): You\'re trying to inject DOM property ' + '\'%s\' which has already been injected. You may be accidentally ' + 'injecting the same DOM property config twice, or you may be ' + 'injecting two configs that have conflicting property names.', propName) : invariant(false) : undefined;
1470
1471 var lowerCased = propName.toLowerCase();
1472 var propConfig = Properties[propName];
1473
1474 var propertyInfo = {
1475 attributeName: lowerCased,
1476 attributeNamespace: null,
1477 propertyName: propName,
1478 mutationMethod: null,
1479
1480 mustUseAttribute: checkMask(propConfig, Injection.MUST_USE_ATTRIBUTE),
1481 mustUseProperty: checkMask(propConfig, Injection.MUST_USE_PROPERTY),
1482 hasSideEffects: checkMask(propConfig, Injection.HAS_SIDE_EFFECTS),
1483 hasBooleanValue: checkMask(propConfig, Injection.HAS_BOOLEAN_VALUE),
1484 hasNumericValue: checkMask(propConfig, Injection.HAS_NUMERIC_VALUE),
1485 hasPositiveNumericValue: checkMask(propConfig, Injection.HAS_POSITIVE_NUMERIC_VALUE),
1486 hasOverloadedBooleanValue: checkMask(propConfig, Injection.HAS_OVERLOADED_BOOLEAN_VALUE)
1487 };
1488
1489 !(!propertyInfo.mustUseAttribute || !propertyInfo.mustUseProperty) ? "development" !== 'production' ? invariant(false, 'DOMProperty: Cannot require using both attribute and property: %s', propName) : invariant(false) : undefined;
1490 !(propertyInfo.mustUseProperty || !propertyInfo.hasSideEffects) ? "development" !== 'production' ? invariant(false, 'DOMProperty: Properties that have side effects must use property: %s', propName) : invariant(false) : undefined;
1491 !(propertyInfo.hasBooleanValue + propertyInfo.hasNumericValue + propertyInfo.hasOverloadedBooleanValue <= 1) ? "development" !== 'production' ? invariant(false, 'DOMProperty: Value can be one of boolean, overloaded boolean, or ' + 'numeric value, but not a combination: %s', propName) : invariant(false) : undefined;
1492
1493 if ("development" !== 'production') {
1494 DOMProperty.getPossibleStandardName[lowerCased] = propName;
1495 }
1496
1497 if (DOMAttributeNames.hasOwnProperty(propName)) {
1498 var attributeName = DOMAttributeNames[propName];
1499 propertyInfo.attributeName = attributeName;
1500 if ("development" !== 'production') {
1501 DOMProperty.getPossibleStandardName[attributeName] = propName;
1502 }
1503 }
1504
1505 if (DOMAttributeNamespaces.hasOwnProperty(propName)) {
1506 propertyInfo.attributeNamespace = DOMAttributeNamespaces[propName];
1507 }
1508
1509 if (DOMPropertyNames.hasOwnProperty(propName)) {
1510 propertyInfo.propertyName = DOMPropertyNames[propName];
1511 }
1512
1513 if (DOMMutationMethods.hasOwnProperty(propName)) {
1514 propertyInfo.mutationMethod = DOMMutationMethods[propName];
1515 }
1516
1517 DOMProperty.properties[propName] = propertyInfo;
1518 }
1519 }
1520};
1521var defaultValueCache = {};
1522
1523/**
1524 * DOMProperty exports lookup objects that can be used like functions:
1525 *
1526 * > DOMProperty.isValid['id']
1527 * true
1528 * > DOMProperty.isValid['foobar']
1529 * undefined
1530 *
1531 * Although this may be confusing, it performs better in general.
1532 *
1533 * @see http://jsperf.com/key-exists
1534 * @see http://jsperf.com/key-missing
1535 */
1536var DOMProperty = {
1537
1538 ID_ATTRIBUTE_NAME: 'data-reactid',
1539
1540 /**
1541 * Map from property "standard name" to an object with info about how to set
1542 * the property in the DOM. Each object contains:
1543 *
1544 * attributeName:
1545 * Used when rendering markup or with `*Attribute()`.
1546 * attributeNamespace
1547 * propertyName:
1548 * Used on DOM node instances. (This includes properties that mutate due to
1549 * external factors.)
1550 * mutationMethod:
1551 * If non-null, used instead of the property or `setAttribute()` after
1552 * initial render.
1553 * mustUseAttribute:
1554 * Whether the property must be accessed and mutated using `*Attribute()`.
1555 * (This includes anything that fails `<propName> in <element>`.)
1556 * mustUseProperty:
1557 * Whether the property must be accessed and mutated as an object property.
1558 * hasSideEffects:
1559 * Whether or not setting a value causes side effects such as triggering
1560 * resources to be loaded or text selection changes. If true, we read from
1561 * the DOM before updating to ensure that the value is only set if it has
1562 * changed.
1563 * hasBooleanValue:
1564 * Whether the property should be removed when set to a falsey value.
1565 * hasNumericValue:
1566 * Whether the property must be numeric or parse as a numeric and should be
1567 * removed when set to a falsey value.
1568 * hasPositiveNumericValue:
1569 * Whether the property must be positive numeric or parse as a positive
1570 * numeric and should be removed when set to a falsey value.
1571 * hasOverloadedBooleanValue:
1572 * Whether the property can be used as a flag as well as with a value.
1573 * Removed when strictly equal to false; present without a value when
1574 * strictly equal to true; present with a value otherwise.
1575 */
1576 properties: {},
1577
1578 /**
1579 * Mapping from lowercase property names to the properly cased version, used
1580 * to warn in the case of missing properties. Available only in __DEV__.
1581 * @type {Object}
1582 */
1583 getPossibleStandardName: "development" !== 'production' ? {} : null,
1584
1585 /**
1586 * All of the isCustomAttribute() functions that have been injected.
1587 */
1588 _isCustomAttributeFunctions: [],
1589
1590 /**
1591 * Checks whether a property name is a custom attribute.
1592 * @method
1593 */
1594 isCustomAttribute: function (attributeName) {
1595 for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) {
1596 var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i];
1597 if (isCustomAttributeFn(attributeName)) {
1598 return true;
1599 }
1600 }
1601 return false;
1602 },
1603
1604 /**
1605 * Returns the default property value for a DOM property (i.e., not an
1606 * attribute). Most default values are '' or false, but not all. Worse yet,
1607 * some (in particular, `type`) vary depending on the type of element.
1608 *
1609 * TODO: Is it better to grab all the possible properties when creating an
1610 * element to avoid having to create the same element twice?
1611 */
1612 getDefaultValueForProperty: function (nodeName, prop) {
1613 var nodeDefaults = defaultValueCache[nodeName];
1614 var testElement;
1615 if (!nodeDefaults) {
1616 defaultValueCache[nodeName] = nodeDefaults = {};
1617 }
1618 if (!(prop in nodeDefaults)) {
1619 testElement = document.createElement(nodeName);
1620 nodeDefaults[prop] = testElement[prop];
1621 }
1622 return nodeDefaults[prop];
1623 },
1624
1625 injection: DOMPropertyInjection
1626};
1627
1628module.exports = DOMProperty;
1629},{"161":161}],11:[function(_dereq_,module,exports){
1630/**
1631 * Copyright 2013-2015, Facebook, Inc.
1632 * All rights reserved.
1633 *
1634 * This source code is licensed under the BSD-style license found in the
1635 * LICENSE file in the root directory of this source tree. An additional grant
1636 * of patent rights can be found in the PATENTS file in the same directory.
1637 *
1638 * @providesModule DOMPropertyOperations
1639 * @typechecks static-only
1640 */
1641
1642'use strict';
1643
1644var DOMProperty = _dereq_(10);
1645var ReactPerf = _dereq_(78);
1646
1647var quoteAttributeValueForBrowser = _dereq_(136);
1648var warning = _dereq_(173);
1649
1650// Simplified subset
1651var VALID_ATTRIBUTE_NAME_REGEX = /^[a-zA-Z_][\w\.\-]*$/;
1652var illegalAttributeNameCache = {};
1653var validatedAttributeNameCache = {};
1654
1655function isAttributeNameSafe(attributeName) {
1656 if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {
1657 return true;
1658 }
1659 if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {
1660 return false;
1661 }
1662 if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
1663 validatedAttributeNameCache[attributeName] = true;
1664 return true;
1665 }
1666 illegalAttributeNameCache[attributeName] = true;
1667 "development" !== 'production' ? warning(false, 'Invalid attribute name: `%s`', attributeName) : undefined;
1668 return false;
1669}
1670
1671function shouldIgnoreValue(propertyInfo, value) {
1672 return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false;
1673}
1674
1675if ("development" !== 'production') {
1676 var reactProps = {
1677 children: true,
1678 dangerouslySetInnerHTML: true,
1679 key: true,
1680 ref: true
1681 };
1682 var warnedProperties = {};
1683
1684 var warnUnknownProperty = function (name) {
1685 if (reactProps.hasOwnProperty(name) && reactProps[name] || warnedProperties.hasOwnProperty(name) && warnedProperties[name]) {
1686 return;
1687 }
1688
1689 warnedProperties[name] = true;
1690 var lowerCasedName = name.toLowerCase();
1691
1692 // data-* attributes should be lowercase; suggest the lowercase version
1693 var standardName = DOMProperty.isCustomAttribute(lowerCasedName) ? lowerCasedName : DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ? DOMProperty.getPossibleStandardName[lowerCasedName] : null;
1694
1695 // For now, only warn when we have a suggested correction. This prevents
1696 // logging too much when using transferPropsTo.
1697 "development" !== 'production' ? warning(standardName == null, 'Unknown DOM property %s. Did you mean %s?', name, standardName) : undefined;
1698 };
1699}
1700
1701/**
1702 * Operations for dealing with DOM properties.
1703 */
1704var DOMPropertyOperations = {
1705
1706 /**
1707 * Creates markup for the ID property.
1708 *
1709 * @param {string} id Unescaped ID.
1710 * @return {string} Markup string.
1711 */
1712 createMarkupForID: function (id) {
1713 return DOMProperty.ID_ATTRIBUTE_NAME + '=' + quoteAttributeValueForBrowser(id);
1714 },
1715
1716 setAttributeForID: function (node, id) {
1717 node.setAttribute(DOMProperty.ID_ATTRIBUTE_NAME, id);
1718 },
1719
1720 /**
1721 * Creates markup for a property.
1722 *
1723 * @param {string} name
1724 * @param {*} value
1725 * @return {?string} Markup string, or null if the property was invalid.
1726 */
1727 createMarkupForProperty: function (name, value) {
1728 var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
1729 if (propertyInfo) {
1730 if (shouldIgnoreValue(propertyInfo, value)) {
1731 return '';
1732 }
1733 var attributeName = propertyInfo.attributeName;
1734 if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
1735 return attributeName + '=""';
1736 }
1737 return attributeName + '=' + quoteAttributeValueForBrowser(value);
1738 } else if (DOMProperty.isCustomAttribute(name)) {
1739 if (value == null) {
1740 return '';
1741 }
1742 return name + '=' + quoteAttributeValueForBrowser(value);
1743 } else if ("development" !== 'production') {
1744 warnUnknownProperty(name);
1745 }
1746 return null;
1747 },
1748
1749 /**
1750 * Creates markup for a custom property.
1751 *
1752 * @param {string} name
1753 * @param {*} value
1754 * @return {string} Markup string, or empty string if the property was invalid.
1755 */
1756 createMarkupForCustomAttribute: function (name, value) {
1757 if (!isAttributeNameSafe(name) || value == null) {
1758 return '';
1759 }
1760 return name + '=' + quoteAttributeValueForBrowser(value);
1761 },
1762
1763 /**
1764 * Sets the value for a property on a node.
1765 *
1766 * @param {DOMElement} node
1767 * @param {string} name
1768 * @param {*} value
1769 */
1770 setValueForProperty: function (node, name, value) {
1771 var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
1772 if (propertyInfo) {
1773 var mutationMethod = propertyInfo.mutationMethod;
1774 if (mutationMethod) {
1775 mutationMethod(node, value);
1776 } else if (shouldIgnoreValue(propertyInfo, value)) {
1777 this.deleteValueForProperty(node, name);
1778 } else if (propertyInfo.mustUseAttribute) {
1779 var attributeName = propertyInfo.attributeName;
1780 var namespace = propertyInfo.attributeNamespace;
1781 // `setAttribute` with objects becomes only `[object]` in IE8/9,
1782 // ('' + value) makes it output the correct toString()-value.
1783 if (namespace) {
1784 node.setAttributeNS(namespace, attributeName, '' + value);
1785 } else if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
1786 node.setAttribute(attributeName, '');
1787 } else {
1788 node.setAttribute(attributeName, '' + value);
1789 }
1790 } else {
1791 var propName = propertyInfo.propertyName;
1792 // Must explicitly cast values for HAS_SIDE_EFFECTS-properties to the
1793 // property type before comparing; only `value` does and is string.
1794 if (!propertyInfo.hasSideEffects || '' + node[propName] !== '' + value) {
1795 // Contrary to `setAttribute`, object properties are properly
1796 // `toString`ed by IE8/9.
1797 node[propName] = value;
1798 }
1799 }
1800 } else if (DOMProperty.isCustomAttribute(name)) {
1801 DOMPropertyOperations.setValueForAttribute(node, name, value);
1802 } else if ("development" !== 'production') {
1803 warnUnknownProperty(name);
1804 }
1805 },
1806
1807 setValueForAttribute: function (node, name, value) {
1808 if (!isAttributeNameSafe(name)) {
1809 return;
1810 }
1811 if (value == null) {
1812 node.removeAttribute(name);
1813 } else {
1814 node.setAttribute(name, '' + value);
1815 }
1816 },
1817
1818 /**
1819 * Deletes the value for a property on a node.
1820 *
1821 * @param {DOMElement} node
1822 * @param {string} name
1823 */
1824 deleteValueForProperty: function (node, name) {
1825 var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
1826 if (propertyInfo) {
1827 var mutationMethod = propertyInfo.mutationMethod;
1828 if (mutationMethod) {
1829 mutationMethod(node, undefined);
1830 } else if (propertyInfo.mustUseAttribute) {
1831 node.removeAttribute(propertyInfo.attributeName);
1832 } else {
1833 var propName = propertyInfo.propertyName;
1834 var defaultValue = DOMProperty.getDefaultValueForProperty(node.nodeName, propName);
1835 if (!propertyInfo.hasSideEffects || '' + node[propName] !== defaultValue) {
1836 node[propName] = defaultValue;
1837 }
1838 }
1839 } else if (DOMProperty.isCustomAttribute(name)) {
1840 node.removeAttribute(name);
1841 } else if ("development" !== 'production') {
1842 warnUnknownProperty(name);
1843 }
1844 }
1845
1846};
1847
1848ReactPerf.measureMethods(DOMPropertyOperations, 'DOMPropertyOperations', {
1849 setValueForProperty: 'setValueForProperty',
1850 setValueForAttribute: 'setValueForAttribute',
1851 deleteValueForProperty: 'deleteValueForProperty'
1852});
1853
1854module.exports = DOMPropertyOperations;
1855},{"10":10,"136":136,"173":173,"78":78}],12:[function(_dereq_,module,exports){
1856/**
1857 * Copyright 2013-2015, Facebook, Inc.
1858 * All rights reserved.
1859 *
1860 * This source code is licensed under the BSD-style license found in the
1861 * LICENSE file in the root directory of this source tree. An additional grant
1862 * of patent rights can be found in the PATENTS file in the same directory.
1863 *
1864 * @providesModule Danger
1865 * @typechecks static-only
1866 */
1867
1868'use strict';
1869
1870var ExecutionEnvironment = _dereq_(147);
1871
1872var createNodesFromMarkup = _dereq_(152);
1873var emptyFunction = _dereq_(153);
1874var getMarkupWrap = _dereq_(157);
1875var invariant = _dereq_(161);
1876
1877var OPEN_TAG_NAME_EXP = /^(<[^ \/>]+)/;
1878var RESULT_INDEX_ATTR = 'data-danger-index';
1879
1880/**
1881 * Extracts the `nodeName` from a string of markup.
1882 *
1883 * NOTE: Extracting the `nodeName` does not require a regular expression match
1884 * because we make assumptions about React-generated markup (i.e. there are no
1885 * spaces surrounding the opening tag and there is at least one attribute).
1886 *
1887 * @param {string} markup String of markup.
1888 * @return {string} Node name of the supplied markup.
1889 * @see http://jsperf.com/extract-nodename
1890 */
1891function getNodeName(markup) {
1892 return markup.substring(1, markup.indexOf(' '));
1893}
1894
1895var Danger = {
1896
1897 /**
1898 * Renders markup into an array of nodes. The markup is expected to render
1899 * into a list of root nodes. Also, the length of `resultList` and
1900 * `markupList` should be the same.
1901 *
1902 * @param {array<string>} markupList List of markup strings to render.
1903 * @return {array<DOMElement>} List of rendered nodes.
1904 * @internal
1905 */
1906 dangerouslyRenderMarkup: function (markupList) {
1907 !ExecutionEnvironment.canUseDOM ? "development" !== 'production' ? invariant(false, 'dangerouslyRenderMarkup(...): Cannot render markup in a worker ' + 'thread. Make sure `window` and `document` are available globally ' + 'before requiring React when unit testing or use ' + 'ReactDOMServer.renderToString for server rendering.') : invariant(false) : undefined;
1908 var nodeName;
1909 var markupByNodeName = {};
1910 // Group markup by `nodeName` if a wrap is necessary, else by '*'.
1911 for (var i = 0; i < markupList.length; i++) {
1912 !markupList[i] ? "development" !== 'production' ? invariant(false, 'dangerouslyRenderMarkup(...): Missing markup.') : invariant(false) : undefined;
1913 nodeName = getNodeName(markupList[i]);
1914 nodeName = getMarkupWrap(nodeName) ? nodeName : '*';
1915 markupByNodeName[nodeName] = markupByNodeName[nodeName] || [];
1916 markupByNodeName[nodeName][i] = markupList[i];
1917 }
1918 var resultList = [];
1919 var resultListAssignmentCount = 0;
1920 for (nodeName in markupByNodeName) {
1921 if (!markupByNodeName.hasOwnProperty(nodeName)) {
1922 continue;
1923 }
1924 var markupListByNodeName = markupByNodeName[nodeName];
1925
1926 // This for-in loop skips the holes of the sparse array. The order of
1927 // iteration should follow the order of assignment, which happens to match
1928 // numerical index order, but we don't rely on that.
1929 var resultIndex;
1930 for (resultIndex in markupListByNodeName) {
1931 if (markupListByNodeName.hasOwnProperty(resultIndex)) {
1932 var markup = markupListByNodeName[resultIndex];
1933
1934 // Push the requested markup with an additional RESULT_INDEX_ATTR
1935 // attribute. If the markup does not start with a < character, it
1936 // will be discarded below (with an appropriate console.error).
1937 markupListByNodeName[resultIndex] = markup.replace(OPEN_TAG_NAME_EXP,
1938 // This index will be parsed back out below.
1939 '$1 ' + RESULT_INDEX_ATTR + '="' + resultIndex + '" ');
1940 }
1941 }
1942
1943 // Render each group of markup with similar wrapping `nodeName`.
1944 var renderNodes = createNodesFromMarkup(markupListByNodeName.join(''), emptyFunction // Do nothing special with <script> tags.
1945 );
1946
1947 for (var j = 0; j < renderNodes.length; ++j) {
1948 var renderNode = renderNodes[j];
1949 if (renderNode.hasAttribute && renderNode.hasAttribute(RESULT_INDEX_ATTR)) {
1950
1951 resultIndex = +renderNode.getAttribute(RESULT_INDEX_ATTR);
1952 renderNode.removeAttribute(RESULT_INDEX_ATTR);
1953
1954 !!resultList.hasOwnProperty(resultIndex) ? "development" !== 'production' ? invariant(false, 'Danger: Assigning to an already-occupied result index.') : invariant(false) : undefined;
1955
1956 resultList[resultIndex] = renderNode;
1957
1958 // This should match resultList.length and markupList.length when
1959 // we're done.
1960 resultListAssignmentCount += 1;
1961 } else if ("development" !== 'production') {
1962 console.error('Danger: Discarding unexpected node:', renderNode);
1963 }
1964 }
1965 }
1966
1967 // Although resultList was populated out of order, it should now be a dense
1968 // array.
1969 !(resultListAssignmentCount === resultList.length) ? "development" !== 'production' ? invariant(false, 'Danger: Did not assign to every index of resultList.') : invariant(false) : undefined;
1970
1971 !(resultList.length === markupList.length) ? "development" !== 'production' ? invariant(false, 'Danger: Expected markup to render %s nodes, but rendered %s.', markupList.length, resultList.length) : invariant(false) : undefined;
1972
1973 return resultList;
1974 },
1975
1976 /**
1977 * Replaces a node with a string of markup at its current position within its
1978 * parent. The markup must render into a single root node.
1979 *
1980 * @param {DOMElement} oldChild Child node to replace.
1981 * @param {string} markup Markup to render in place of the child node.
1982 * @internal
1983 */
1984 dangerouslyReplaceNodeWithMarkup: function (oldChild, markup) {
1985 !ExecutionEnvironment.canUseDOM ? "development" !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot render markup in a ' + 'worker thread. Make sure `window` and `document` are available ' + 'globally before requiring React when unit testing or use ' + 'ReactDOMServer.renderToString() for server rendering.') : invariant(false) : undefined;
1986 !markup ? "development" !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Missing markup.') : invariant(false) : undefined;
1987 !(oldChild.tagName.toLowerCase() !== 'html') ? "development" !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot replace markup of the ' + '<html> node. This is because browser quirks make this unreliable ' + 'and/or slow. If you want to render to the root you must use ' + 'server rendering. See ReactDOMServer.renderToString().') : invariant(false) : undefined;
1988
1989 var newChild;
1990 if (typeof markup === 'string') {
1991 newChild = createNodesFromMarkup(markup, emptyFunction)[0];
1992 } else {
1993 newChild = markup;
1994 }
1995 oldChild.parentNode.replaceChild(newChild, oldChild);
1996 }
1997
1998};
1999
2000module.exports = Danger;
2001},{"147":147,"152":152,"153":153,"157":157,"161":161}],13:[function(_dereq_,module,exports){
2002/**
2003 * Copyright 2013-2015, Facebook, Inc.
2004 * All rights reserved.
2005 *
2006 * This source code is licensed under the BSD-style license found in the
2007 * LICENSE file in the root directory of this source tree. An additional grant
2008 * of patent rights can be found in the PATENTS file in the same directory.
2009 *
2010 * @providesModule DefaultEventPluginOrder
2011 */
2012
2013'use strict';
2014
2015var keyOf = _dereq_(166);
2016
2017/**
2018 * Module that is injectable into `EventPluginHub`, that specifies a
2019 * deterministic ordering of `EventPlugin`s. A convenient way to reason about
2020 * plugins, without having to package every one of them. This is better than
2021 * having plugins be ordered in the same order that they are injected because
2022 * that ordering would be influenced by the packaging order.
2023 * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that
2024 * preventing default on events is convenient in `SimpleEventPlugin` handlers.
2025 */
2026var DefaultEventPluginOrder = [keyOf({ ResponderEventPlugin: null }), keyOf({ SimpleEventPlugin: null }), keyOf({ TapEventPlugin: null }), keyOf({ EnterLeaveEventPlugin: null }), keyOf({ ChangeEventPlugin: null }), keyOf({ SelectEventPlugin: null }), keyOf({ BeforeInputEventPlugin: null })];
2027
2028module.exports = DefaultEventPluginOrder;
2029},{"166":166}],14:[function(_dereq_,module,exports){
2030/**
2031 * Copyright 2013-2015, Facebook, Inc.
2032 * All rights reserved.
2033 *
2034 * This source code is licensed under the BSD-style license found in the
2035 * LICENSE file in the root directory of this source tree. An additional grant
2036 * of patent rights can be found in the PATENTS file in the same directory.
2037 *
2038 * @providesModule EnterLeaveEventPlugin
2039 * @typechecks static-only
2040 */
2041
2042'use strict';
2043
2044var EventConstants = _dereq_(15);
2045var EventPropagators = _dereq_(19);
2046var SyntheticMouseEvent = _dereq_(109);
2047
2048var ReactMount = _dereq_(72);
2049var keyOf = _dereq_(166);
2050
2051var topLevelTypes = EventConstants.topLevelTypes;
2052var getFirstReactDOM = ReactMount.getFirstReactDOM;
2053
2054var eventTypes = {
2055 mouseEnter: {
2056 registrationName: keyOf({ onMouseEnter: null }),
2057 dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver]
2058 },
2059 mouseLeave: {
2060 registrationName: keyOf({ onMouseLeave: null }),
2061 dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver]
2062 }
2063};
2064
2065var extractedEvents = [null, null];
2066
2067var EnterLeaveEventPlugin = {
2068
2069 eventTypes: eventTypes,
2070
2071 /**
2072 * For almost every interaction we care about, there will be both a top-level
2073 * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that
2074 * we do not extract duplicate events. However, moving the mouse into the
2075 * browser from outside will not fire a `mouseout` event. In this case, we use
2076 * the `mouseover` top-level event.
2077 *
2078 * @param {string} topLevelType Record from `EventConstants`.
2079 * @param {DOMEventTarget} topLevelTarget The listening component root node.
2080 * @param {string} topLevelTargetID ID of `topLevelTarget`.
2081 * @param {object} nativeEvent Native browser event.
2082 * @return {*} An accumulation of synthetic events.
2083 * @see {EventPluginHub.extractEvents}
2084 */
2085 extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
2086 if (topLevelType === topLevelTypes.topMouseOver && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {
2087 return null;
2088 }
2089 if (topLevelType !== topLevelTypes.topMouseOut && topLevelType !== topLevelTypes.topMouseOver) {
2090 // Must not be a mouse in or mouse out - ignoring.
2091 return null;
2092 }
2093
2094 var win;
2095 if (topLevelTarget.window === topLevelTarget) {
2096 // `topLevelTarget` is probably a window object.
2097 win = topLevelTarget;
2098 } else {
2099 // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
2100 var doc = topLevelTarget.ownerDocument;
2101 if (doc) {
2102 win = doc.defaultView || doc.parentWindow;
2103 } else {
2104 win = window;
2105 }
2106 }
2107
2108 var from;
2109 var to;
2110 var fromID = '';
2111 var toID = '';
2112 if (topLevelType === topLevelTypes.topMouseOut) {
2113 from = topLevelTarget;
2114 fromID = topLevelTargetID;
2115 to = getFirstReactDOM(nativeEvent.relatedTarget || nativeEvent.toElement);
2116 if (to) {
2117 toID = ReactMount.getID(to);
2118 } else {
2119 to = win;
2120 }
2121 to = to || win;
2122 } else {
2123 from = win;
2124 to = topLevelTarget;
2125 toID = topLevelTargetID;
2126 }
2127
2128 if (from === to) {
2129 // Nothing pertains to our managed components.
2130 return null;
2131 }
2132
2133 var leave = SyntheticMouseEvent.getPooled(eventTypes.mouseLeave, fromID, nativeEvent, nativeEventTarget);
2134 leave.type = 'mouseleave';
2135 leave.target = from;
2136 leave.relatedTarget = to;
2137
2138 var enter = SyntheticMouseEvent.getPooled(eventTypes.mouseEnter, toID, nativeEvent, nativeEventTarget);
2139 enter.type = 'mouseenter';
2140 enter.target = to;
2141 enter.relatedTarget = from;
2142
2143 EventPropagators.accumulateEnterLeaveDispatches(leave, enter, fromID, toID);
2144
2145 extractedEvents[0] = leave;
2146 extractedEvents[1] = enter;
2147
2148 return extractedEvents;
2149 }
2150
2151};
2152
2153module.exports = EnterLeaveEventPlugin;
2154},{"109":109,"15":15,"166":166,"19":19,"72":72}],15:[function(_dereq_,module,exports){
2155/**
2156 * Copyright 2013-2015, Facebook, Inc.
2157 * All rights reserved.
2158 *
2159 * This source code is licensed under the BSD-style license found in the
2160 * LICENSE file in the root directory of this source tree. An additional grant
2161 * of patent rights can be found in the PATENTS file in the same directory.
2162 *
2163 * @providesModule EventConstants
2164 */
2165
2166'use strict';
2167
2168var keyMirror = _dereq_(165);
2169
2170var PropagationPhases = keyMirror({ bubbled: null, captured: null });
2171
2172/**
2173 * Types of raw signals from the browser caught at the top level.
2174 */
2175var topLevelTypes = keyMirror({
2176 topAbort: null,
2177 topBlur: null,
2178 topCanPlay: null,
2179 topCanPlayThrough: null,
2180 topChange: null,
2181 topClick: null,
2182 topCompositionEnd: null,
2183 topCompositionStart: null,
2184 topCompositionUpdate: null,
2185 topContextMenu: null,
2186 topCopy: null,
2187 topCut: null,
2188 topDoubleClick: null,
2189 topDrag: null,
2190 topDragEnd: null,
2191 topDragEnter: null,
2192 topDragExit: null,
2193 topDragLeave: null,
2194 topDragOver: null,
2195 topDragStart: null,
2196 topDrop: null,
2197 topDurationChange: null,
2198 topEmptied: null,
2199 topEncrypted: null,
2200 topEnded: null,
2201 topError: null,
2202 topFocus: null,
2203 topInput: null,
2204 topKeyDown: null,
2205 topKeyPress: null,
2206 topKeyUp: null,
2207 topLoad: null,
2208 topLoadedData: null,
2209 topLoadedMetadata: null,
2210 topLoadStart: null,
2211 topMouseDown: null,
2212 topMouseMove: null,
2213 topMouseOut: null,
2214 topMouseOver: null,
2215 topMouseUp: null,
2216 topPaste: null,
2217 topPause: null,
2218 topPlay: null,
2219 topPlaying: null,
2220 topProgress: null,
2221 topRateChange: null,
2222 topReset: null,
2223 topScroll: null,
2224 topSeeked: null,
2225 topSeeking: null,
2226 topSelectionChange: null,
2227 topStalled: null,
2228 topSubmit: null,
2229 topSuspend: null,
2230 topTextInput: null,
2231 topTimeUpdate: null,
2232 topTouchCancel: null,
2233 topTouchEnd: null,
2234 topTouchMove: null,
2235 topTouchStart: null,
2236 topVolumeChange: null,
2237 topWaiting: null,
2238 topWheel: null
2239});
2240
2241var EventConstants = {
2242 topLevelTypes: topLevelTypes,
2243 PropagationPhases: PropagationPhases
2244};
2245
2246module.exports = EventConstants;
2247},{"165":165}],16:[function(_dereq_,module,exports){
2248/**
2249 * Copyright 2013-2015, Facebook, Inc.
2250 * All rights reserved.
2251 *
2252 * This source code is licensed under the BSD-style license found in the
2253 * LICENSE file in the root directory of this source tree. An additional grant
2254 * of patent rights can be found in the PATENTS file in the same directory.
2255 *
2256 * @providesModule EventPluginHub
2257 */
2258
2259'use strict';
2260
2261var EventPluginRegistry = _dereq_(17);
2262var EventPluginUtils = _dereq_(18);
2263var ReactErrorUtils = _dereq_(61);
2264
2265var accumulateInto = _dereq_(115);
2266var forEachAccumulated = _dereq_(124);
2267var invariant = _dereq_(161);
2268var warning = _dereq_(173);
2269
2270/**
2271 * Internal store for event listeners
2272 */
2273var listenerBank = {};
2274
2275/**
2276 * Internal queue of events that have accumulated their dispatches and are
2277 * waiting to have their dispatches executed.
2278 */
2279var eventQueue = null;
2280
2281/**
2282 * Dispatches an event and releases it back into the pool, unless persistent.
2283 *
2284 * @param {?object} event Synthetic event to be dispatched.
2285 * @param {boolean} simulated If the event is simulated (changes exn behavior)
2286 * @private
2287 */
2288var executeDispatchesAndRelease = function (event, simulated) {
2289 if (event) {
2290 EventPluginUtils.executeDispatchesInOrder(event, simulated);
2291
2292 if (!event.isPersistent()) {
2293 event.constructor.release(event);
2294 }
2295 }
2296};
2297var executeDispatchesAndReleaseSimulated = function (e) {
2298 return executeDispatchesAndRelease(e, true);
2299};
2300var executeDispatchesAndReleaseTopLevel = function (e) {
2301 return executeDispatchesAndRelease(e, false);
2302};
2303
2304/**
2305 * - `InstanceHandle`: [required] Module that performs logical traversals of DOM
2306 * hierarchy given ids of the logical DOM elements involved.
2307 */
2308var InstanceHandle = null;
2309
2310function validateInstanceHandle() {
2311 var valid = InstanceHandle && InstanceHandle.traverseTwoPhase && InstanceHandle.traverseEnterLeave;
2312 "development" !== 'production' ? warning(valid, 'InstanceHandle not injected before use!') : undefined;
2313}
2314
2315/**
2316 * This is a unified interface for event plugins to be installed and configured.
2317 *
2318 * Event plugins can implement the following properties:
2319 *
2320 * `extractEvents` {function(string, DOMEventTarget, string, object): *}
2321 * Required. When a top-level event is fired, this method is expected to
2322 * extract synthetic events that will in turn be queued and dispatched.
2323 *
2324 * `eventTypes` {object}
2325 * Optional, plugins that fire events must publish a mapping of registration
2326 * names that are used to register listeners. Values of this mapping must
2327 * be objects that contain `registrationName` or `phasedRegistrationNames`.
2328 *
2329 * `executeDispatch` {function(object, function, string)}
2330 * Optional, allows plugins to override how an event gets dispatched. By
2331 * default, the listener is simply invoked.
2332 *
2333 * Each plugin that is injected into `EventsPluginHub` is immediately operable.
2334 *
2335 * @public
2336 */
2337var EventPluginHub = {
2338
2339 /**
2340 * Methods for injecting dependencies.
2341 */
2342 injection: {
2343
2344 /**
2345 * @param {object} InjectedMount
2346 * @public
2347 */
2348 injectMount: EventPluginUtils.injection.injectMount,
2349
2350 /**
2351 * @param {object} InjectedInstanceHandle
2352 * @public
2353 */
2354 injectInstanceHandle: function (InjectedInstanceHandle) {
2355 InstanceHandle = InjectedInstanceHandle;
2356 if ("development" !== 'production') {
2357 validateInstanceHandle();
2358 }
2359 },
2360
2361 getInstanceHandle: function () {
2362 if ("development" !== 'production') {
2363 validateInstanceHandle();
2364 }
2365 return InstanceHandle;
2366 },
2367
2368 /**
2369 * @param {array} InjectedEventPluginOrder
2370 * @public
2371 */
2372 injectEventPluginOrder: EventPluginRegistry.injectEventPluginOrder,
2373
2374 /**
2375 * @param {object} injectedNamesToPlugins Map from names to plugin modules.
2376 */
2377 injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName
2378
2379 },
2380
2381 eventNameDispatchConfigs: EventPluginRegistry.eventNameDispatchConfigs,
2382
2383 registrationNameModules: EventPluginRegistry.registrationNameModules,
2384
2385 /**
2386 * Stores `listener` at `listenerBank[registrationName][id]`. Is idempotent.
2387 *
2388 * @param {string} id ID of the DOM element.
2389 * @param {string} registrationName Name of listener (e.g. `onClick`).
2390 * @param {?function} listener The callback to store.
2391 */
2392 putListener: function (id, registrationName, listener) {
2393 !(typeof listener === 'function') ? "development" !== 'production' ? invariant(false, 'Expected %s listener to be a function, instead got type %s', registrationName, typeof listener) : invariant(false) : undefined;
2394
2395 var bankForRegistrationName = listenerBank[registrationName] || (listenerBank[registrationName] = {});
2396 bankForRegistrationName[id] = listener;
2397
2398 var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
2399 if (PluginModule && PluginModule.didPutListener) {
2400 PluginModule.didPutListener(id, registrationName, listener);
2401 }
2402 },
2403
2404 /**
2405 * @param {string} id ID of the DOM element.
2406 * @param {string} registrationName Name of listener (e.g. `onClick`).
2407 * @return {?function} The stored callback.
2408 */
2409 getListener: function (id, registrationName) {
2410 var bankForRegistrationName = listenerBank[registrationName];
2411 return bankForRegistrationName && bankForRegistrationName[id];
2412 },
2413
2414 /**
2415 * Deletes a listener from the registration bank.
2416 *
2417 * @param {string} id ID of the DOM element.
2418 * @param {string} registrationName Name of listener (e.g. `onClick`).
2419 */
2420 deleteListener: function (id, registrationName) {
2421 var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
2422 if (PluginModule && PluginModule.willDeleteListener) {
2423 PluginModule.willDeleteListener(id, registrationName);
2424 }
2425
2426 var bankForRegistrationName = listenerBank[registrationName];
2427 // TODO: This should never be null -- when is it?
2428 if (bankForRegistrationName) {
2429 delete bankForRegistrationName[id];
2430 }
2431 },
2432
2433 /**
2434 * Deletes all listeners for the DOM element with the supplied ID.
2435 *
2436 * @param {string} id ID of the DOM element.
2437 */
2438 deleteAllListeners: function (id) {
2439 for (var registrationName in listenerBank) {
2440 if (!listenerBank[registrationName][id]) {
2441 continue;
2442 }
2443
2444 var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
2445 if (PluginModule && PluginModule.willDeleteListener) {
2446 PluginModule.willDeleteListener(id, registrationName);
2447 }
2448
2449 delete listenerBank[registrationName][id];
2450 }
2451 },
2452
2453 /**
2454 * Allows registered plugins an opportunity to extract events from top-level
2455 * native browser events.
2456 *
2457 * @param {string} topLevelType Record from `EventConstants`.
2458 * @param {DOMEventTarget} topLevelTarget The listening component root node.
2459 * @param {string} topLevelTargetID ID of `topLevelTarget`.
2460 * @param {object} nativeEvent Native browser event.
2461 * @return {*} An accumulation of synthetic events.
2462 * @internal
2463 */
2464 extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
2465 var events;
2466 var plugins = EventPluginRegistry.plugins;
2467 for (var i = 0; i < plugins.length; i++) {
2468 // Not every plugin in the ordering may be loaded at runtime.
2469 var possiblePlugin = plugins[i];
2470 if (possiblePlugin) {
2471 var extractedEvents = possiblePlugin.extractEvents(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget);
2472 if (extractedEvents) {
2473 events = accumulateInto(events, extractedEvents);
2474 }
2475 }
2476 }
2477 return events;
2478 },
2479
2480 /**
2481 * Enqueues a synthetic event that should be dispatched when
2482 * `processEventQueue` is invoked.
2483 *
2484 * @param {*} events An accumulation of synthetic events.
2485 * @internal
2486 */
2487 enqueueEvents: function (events) {
2488 if (events) {
2489 eventQueue = accumulateInto(eventQueue, events);
2490 }
2491 },
2492
2493 /**
2494 * Dispatches all synthetic events on the event queue.
2495 *
2496 * @internal
2497 */
2498 processEventQueue: function (simulated) {
2499 // Set `eventQueue` to null before processing it so that we can tell if more
2500 // events get enqueued while processing.
2501 var processingEventQueue = eventQueue;
2502 eventQueue = null;
2503 if (simulated) {
2504 forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated);
2505 } else {
2506 forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
2507 }
2508 !!eventQueue ? "development" !== 'production' ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing ' + 'an event queue. Support for this has not yet been implemented.') : invariant(false) : undefined;
2509 // This would be a good time to rethrow if any of the event handlers threw.
2510 ReactErrorUtils.rethrowCaughtError();
2511 },
2512
2513 /**
2514 * These are needed for tests only. Do not use!
2515 */
2516 __purge: function () {
2517 listenerBank = {};
2518 },
2519
2520 __getListenerBank: function () {
2521 return listenerBank;
2522 }
2523
2524};
2525
2526module.exports = EventPluginHub;
2527},{"115":115,"124":124,"161":161,"17":17,"173":173,"18":18,"61":61}],17:[function(_dereq_,module,exports){
2528/**
2529 * Copyright 2013-2015, Facebook, Inc.
2530 * All rights reserved.
2531 *
2532 * This source code is licensed under the BSD-style license found in the
2533 * LICENSE file in the root directory of this source tree. An additional grant
2534 * of patent rights can be found in the PATENTS file in the same directory.
2535 *
2536 * @providesModule EventPluginRegistry
2537 * @typechecks static-only
2538 */
2539
2540'use strict';
2541
2542var invariant = _dereq_(161);
2543
2544/**
2545 * Injectable ordering of event plugins.
2546 */
2547var EventPluginOrder = null;
2548
2549/**
2550 * Injectable mapping from names to event plugin modules.
2551 */
2552var namesToPlugins = {};
2553
2554/**
2555 * Recomputes the plugin list using the injected plugins and plugin ordering.
2556 *
2557 * @private
2558 */
2559function recomputePluginOrdering() {
2560 if (!EventPluginOrder) {
2561 // Wait until an `EventPluginOrder` is injected.
2562 return;
2563 }
2564 for (var pluginName in namesToPlugins) {
2565 var PluginModule = namesToPlugins[pluginName];
2566 var pluginIndex = EventPluginOrder.indexOf(pluginName);
2567 !(pluginIndex > -1) ? "development" !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in ' + 'the plugin ordering, `%s`.', pluginName) : invariant(false) : undefined;
2568 if (EventPluginRegistry.plugins[pluginIndex]) {
2569 continue;
2570 }
2571 !PluginModule.extractEvents ? "development" !== 'production' ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` ' + 'method, but `%s` does not.', pluginName) : invariant(false) : undefined;
2572 EventPluginRegistry.plugins[pluginIndex] = PluginModule;
2573 var publishedEvents = PluginModule.eventTypes;
2574 for (var eventName in publishedEvents) {
2575 !publishEventForPlugin(publishedEvents[eventName], PluginModule, eventName) ? "development" !== 'production' ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : invariant(false) : undefined;
2576 }
2577 }
2578}
2579
2580/**
2581 * Publishes an event so that it can be dispatched by the supplied plugin.
2582 *
2583 * @param {object} dispatchConfig Dispatch configuration for the event.
2584 * @param {object} PluginModule Plugin publishing the event.
2585 * @return {boolean} True if the event was successfully published.
2586 * @private
2587 */
2588function publishEventForPlugin(dispatchConfig, PluginModule, eventName) {
2589 !!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName) ? "development" !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same ' + 'event name, `%s`.', eventName) : invariant(false) : undefined;
2590 EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig;
2591
2592 var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
2593 if (phasedRegistrationNames) {
2594 for (var phaseName in phasedRegistrationNames) {
2595 if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
2596 var phasedRegistrationName = phasedRegistrationNames[phaseName];
2597 publishRegistrationName(phasedRegistrationName, PluginModule, eventName);
2598 }
2599 }
2600 return true;
2601 } else if (dispatchConfig.registrationName) {
2602 publishRegistrationName(dispatchConfig.registrationName, PluginModule, eventName);
2603 return true;
2604 }
2605 return false;
2606}
2607
2608/**
2609 * Publishes a registration name that is used to identify dispatched events and
2610 * can be used with `EventPluginHub.putListener` to register listeners.
2611 *
2612 * @param {string} registrationName Registration name to add.
2613 * @param {object} PluginModule Plugin publishing the event.
2614 * @private
2615 */
2616function publishRegistrationName(registrationName, PluginModule, eventName) {
2617 !!EventPluginRegistry.registrationNameModules[registrationName] ? "development" !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same ' + 'registration name, `%s`.', registrationName) : invariant(false) : undefined;
2618 EventPluginRegistry.registrationNameModules[registrationName] = PluginModule;
2619 EventPluginRegistry.registrationNameDependencies[registrationName] = PluginModule.eventTypes[eventName].dependencies;
2620}
2621
2622/**
2623 * Registers plugins so that they can extract and dispatch events.
2624 *
2625 * @see {EventPluginHub}
2626 */
2627var EventPluginRegistry = {
2628
2629 /**
2630 * Ordered list of injected plugins.
2631 */
2632 plugins: [],
2633
2634 /**
2635 * Mapping from event name to dispatch config
2636 */
2637 eventNameDispatchConfigs: {},
2638
2639 /**
2640 * Mapping from registration name to plugin module
2641 */
2642 registrationNameModules: {},
2643
2644 /**
2645 * Mapping from registration name to event name
2646 */
2647 registrationNameDependencies: {},
2648
2649 /**
2650 * Injects an ordering of plugins (by plugin name). This allows the ordering
2651 * to be decoupled from injection of the actual plugins so that ordering is
2652 * always deterministic regardless of packaging, on-the-fly injection, etc.
2653 *
2654 * @param {array} InjectedEventPluginOrder
2655 * @internal
2656 * @see {EventPluginHub.injection.injectEventPluginOrder}
2657 */
2658 injectEventPluginOrder: function (InjectedEventPluginOrder) {
2659 !!EventPluginOrder ? "development" !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than ' + 'once. You are likely trying to load more than one copy of React.') : invariant(false) : undefined;
2660 // Clone the ordering so it cannot be dynamically mutated.
2661 EventPluginOrder = Array.prototype.slice.call(InjectedEventPluginOrder);
2662 recomputePluginOrdering();
2663 },
2664
2665 /**
2666 * Injects plugins to be used by `EventPluginHub`. The plugin names must be
2667 * in the ordering injected by `injectEventPluginOrder`.
2668 *
2669 * Plugins can be injected as part of page initialization or on-the-fly.
2670 *
2671 * @param {object} injectedNamesToPlugins Map from names to plugin modules.
2672 * @internal
2673 * @see {EventPluginHub.injection.injectEventPluginsByName}
2674 */
2675 injectEventPluginsByName: function (injectedNamesToPlugins) {
2676 var isOrderingDirty = false;
2677 for (var pluginName in injectedNamesToPlugins) {
2678 if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
2679 continue;
2680 }
2681 var PluginModule = injectedNamesToPlugins[pluginName];
2682 if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== PluginModule) {
2683 !!namesToPlugins[pluginName] ? "development" !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins ' + 'using the same name, `%s`.', pluginName) : invariant(false) : undefined;
2684 namesToPlugins[pluginName] = PluginModule;
2685 isOrderingDirty = true;
2686 }
2687 }
2688 if (isOrderingDirty) {
2689 recomputePluginOrdering();
2690 }
2691 },
2692
2693 /**
2694 * Looks up the plugin for the supplied event.
2695 *
2696 * @param {object} event A synthetic event.
2697 * @return {?object} The plugin that created the supplied event.
2698 * @internal
2699 */
2700 getPluginModuleForEvent: function (event) {
2701 var dispatchConfig = event.dispatchConfig;
2702 if (dispatchConfig.registrationName) {
2703 return EventPluginRegistry.registrationNameModules[dispatchConfig.registrationName] || null;
2704 }
2705 for (var phase in dispatchConfig.phasedRegistrationNames) {
2706 if (!dispatchConfig.phasedRegistrationNames.hasOwnProperty(phase)) {
2707 continue;
2708 }
2709 var PluginModule = EventPluginRegistry.registrationNameModules[dispatchConfig.phasedRegistrationNames[phase]];
2710 if (PluginModule) {
2711 return PluginModule;
2712 }
2713 }
2714 return null;
2715 },
2716
2717 /**
2718 * Exposed for unit testing.
2719 * @private
2720 */
2721 _resetEventPlugins: function () {
2722 EventPluginOrder = null;
2723 for (var pluginName in namesToPlugins) {
2724 if (namesToPlugins.hasOwnProperty(pluginName)) {
2725 delete namesToPlugins[pluginName];
2726 }
2727 }
2728 EventPluginRegistry.plugins.length = 0;
2729
2730 var eventNameDispatchConfigs = EventPluginRegistry.eventNameDispatchConfigs;
2731 for (var eventName in eventNameDispatchConfigs) {
2732 if (eventNameDispatchConfigs.hasOwnProperty(eventName)) {
2733 delete eventNameDispatchConfigs[eventName];
2734 }
2735 }
2736
2737 var registrationNameModules = EventPluginRegistry.registrationNameModules;
2738 for (var registrationName in registrationNameModules) {
2739 if (registrationNameModules.hasOwnProperty(registrationName)) {
2740 delete registrationNameModules[registrationName];
2741 }
2742 }
2743 }
2744
2745};
2746
2747module.exports = EventPluginRegistry;
2748},{"161":161}],18:[function(_dereq_,module,exports){
2749/**
2750 * Copyright 2013-2015, Facebook, Inc.
2751 * All rights reserved.
2752 *
2753 * This source code is licensed under the BSD-style license found in the
2754 * LICENSE file in the root directory of this source tree. An additional grant
2755 * of patent rights can be found in the PATENTS file in the same directory.
2756 *
2757 * @providesModule EventPluginUtils
2758 */
2759
2760'use strict';
2761
2762var EventConstants = _dereq_(15);
2763var ReactErrorUtils = _dereq_(61);
2764
2765var invariant = _dereq_(161);
2766var warning = _dereq_(173);
2767
2768/**
2769 * Injected dependencies:
2770 */
2771
2772/**
2773 * - `Mount`: [required] Module that can convert between React dom IDs and
2774 * actual node references.
2775 */
2776var injection = {
2777 Mount: null,
2778 injectMount: function (InjectedMount) {
2779 injection.Mount = InjectedMount;
2780 if ("development" !== 'production') {
2781 "development" !== 'production' ? warning(InjectedMount && InjectedMount.getNode && InjectedMount.getID, 'EventPluginUtils.injection.injectMount(...): Injected Mount ' + 'module is missing getNode or getID.') : undefined;
2782 }
2783 }
2784};
2785
2786var topLevelTypes = EventConstants.topLevelTypes;
2787
2788function isEndish(topLevelType) {
2789 return topLevelType === topLevelTypes.topMouseUp || topLevelType === topLevelTypes.topTouchEnd || topLevelType === topLevelTypes.topTouchCancel;
2790}
2791
2792function isMoveish(topLevelType) {
2793 return topLevelType === topLevelTypes.topMouseMove || topLevelType === topLevelTypes.topTouchMove;
2794}
2795function isStartish(topLevelType) {
2796 return topLevelType === topLevelTypes.topMouseDown || topLevelType === topLevelTypes.topTouchStart;
2797}
2798
2799var validateEventDispatches;
2800if ("development" !== 'production') {
2801 validateEventDispatches = function (event) {
2802 var dispatchListeners = event._dispatchListeners;
2803 var dispatchIDs = event._dispatchIDs;
2804
2805 var listenersIsArr = Array.isArray(dispatchListeners);
2806 var idsIsArr = Array.isArray(dispatchIDs);
2807 var IDsLen = idsIsArr ? dispatchIDs.length : dispatchIDs ? 1 : 0;
2808 var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;
2809
2810 "development" !== 'production' ? warning(idsIsArr === listenersIsArr && IDsLen === listenersLen, 'EventPluginUtils: Invalid `event`.') : undefined;
2811 };
2812}
2813
2814/**
2815 * Dispatch the event to the listener.
2816 * @param {SyntheticEvent} event SyntheticEvent to handle
2817 * @param {boolean} simulated If the event is simulated (changes exn behavior)
2818 * @param {function} listener Application-level callback
2819 * @param {string} domID DOM id to pass to the callback.
2820 */
2821function executeDispatch(event, simulated, listener, domID) {
2822 var type = event.type || 'unknown-event';
2823 event.currentTarget = injection.Mount.getNode(domID);
2824 if (simulated) {
2825 ReactErrorUtils.invokeGuardedCallbackWithCatch(type, listener, event, domID);
2826 } else {
2827 ReactErrorUtils.invokeGuardedCallback(type, listener, event, domID);
2828 }
2829 event.currentTarget = null;
2830}
2831
2832/**
2833 * Standard/simple iteration through an event's collected dispatches.
2834 */
2835function executeDispatchesInOrder(event, simulated) {
2836 var dispatchListeners = event._dispatchListeners;
2837 var dispatchIDs = event._dispatchIDs;
2838 if ("development" !== 'production') {
2839 validateEventDispatches(event);
2840 }
2841 if (Array.isArray(dispatchListeners)) {
2842 for (var i = 0; i < dispatchListeners.length; i++) {
2843 if (event.isPropagationStopped()) {
2844 break;
2845 }
2846 // Listeners and IDs are two parallel arrays that are always in sync.
2847 executeDispatch(event, simulated, dispatchListeners[i], dispatchIDs[i]);
2848 }
2849 } else if (dispatchListeners) {
2850 executeDispatch(event, simulated, dispatchListeners, dispatchIDs);
2851 }
2852 event._dispatchListeners = null;
2853 event._dispatchIDs = null;
2854}
2855
2856/**
2857 * Standard/simple iteration through an event's collected dispatches, but stops
2858 * at the first dispatch execution returning true, and returns that id.
2859 *
2860 * @return {?string} id of the first dispatch execution who's listener returns
2861 * true, or null if no listener returned true.
2862 */
2863function executeDispatchesInOrderStopAtTrueImpl(event) {
2864 var dispatchListeners = event._dispatchListeners;
2865 var dispatchIDs = event._dispatchIDs;
2866 if ("development" !== 'production') {
2867 validateEventDispatches(event);
2868 }
2869 if (Array.isArray(dispatchListeners)) {
2870 for (var i = 0; i < dispatchListeners.length; i++) {
2871 if (event.isPropagationStopped()) {
2872 break;
2873 }
2874 // Listeners and IDs are two parallel arrays that are always in sync.
2875 if (dispatchListeners[i](event, dispatchIDs[i])) {
2876 return dispatchIDs[i];
2877 }
2878 }
2879 } else if (dispatchListeners) {
2880 if (dispatchListeners(event, dispatchIDs)) {
2881 return dispatchIDs;
2882 }
2883 }
2884 return null;
2885}
2886
2887/**
2888 * @see executeDispatchesInOrderStopAtTrueImpl
2889 */
2890function executeDispatchesInOrderStopAtTrue(event) {
2891 var ret = executeDispatchesInOrderStopAtTrueImpl(event);
2892 event._dispatchIDs = null;
2893 event._dispatchListeners = null;
2894 return ret;
2895}
2896
2897/**
2898 * Execution of a "direct" dispatch - there must be at most one dispatch
2899 * accumulated on the event or it is considered an error. It doesn't really make
2900 * sense for an event with multiple dispatches (bubbled) to keep track of the
2901 * return values at each dispatch execution, but it does tend to make sense when
2902 * dealing with "direct" dispatches.
2903 *
2904 * @return {*} The return value of executing the single dispatch.
2905 */
2906function executeDirectDispatch(event) {
2907 if ("development" !== 'production') {
2908 validateEventDispatches(event);
2909 }
2910 var dispatchListener = event._dispatchListeners;
2911 var dispatchID = event._dispatchIDs;
2912 !!Array.isArray(dispatchListener) ? "development" !== 'production' ? invariant(false, 'executeDirectDispatch(...): Invalid `event`.') : invariant(false) : undefined;
2913 var res = dispatchListener ? dispatchListener(event, dispatchID) : null;
2914 event._dispatchListeners = null;
2915 event._dispatchIDs = null;
2916 return res;
2917}
2918
2919/**
2920 * @param {SyntheticEvent} event
2921 * @return {boolean} True iff number of dispatches accumulated is greater than 0.
2922 */
2923function hasDispatches(event) {
2924 return !!event._dispatchListeners;
2925}
2926
2927/**
2928 * General utilities that are useful in creating custom Event Plugins.
2929 */
2930var EventPluginUtils = {
2931 isEndish: isEndish,
2932 isMoveish: isMoveish,
2933 isStartish: isStartish,
2934
2935 executeDirectDispatch: executeDirectDispatch,
2936 executeDispatchesInOrder: executeDispatchesInOrder,
2937 executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue,
2938 hasDispatches: hasDispatches,
2939
2940 getNode: function (id) {
2941 return injection.Mount.getNode(id);
2942 },
2943 getID: function (node) {
2944 return injection.Mount.getID(node);
2945 },
2946
2947 injection: injection
2948};
2949
2950module.exports = EventPluginUtils;
2951},{"15":15,"161":161,"173":173,"61":61}],19:[function(_dereq_,module,exports){
2952/**
2953 * Copyright 2013-2015, Facebook, Inc.
2954 * All rights reserved.
2955 *
2956 * This source code is licensed under the BSD-style license found in the
2957 * LICENSE file in the root directory of this source tree. An additional grant
2958 * of patent rights can be found in the PATENTS file in the same directory.
2959 *
2960 * @providesModule EventPropagators
2961 */
2962
2963'use strict';
2964
2965var EventConstants = _dereq_(15);
2966var EventPluginHub = _dereq_(16);
2967
2968var warning = _dereq_(173);
2969
2970var accumulateInto = _dereq_(115);
2971var forEachAccumulated = _dereq_(124);
2972
2973var PropagationPhases = EventConstants.PropagationPhases;
2974var getListener = EventPluginHub.getListener;
2975
2976/**
2977 * Some event types have a notion of different registration names for different
2978 * "phases" of propagation. This finds listeners by a given phase.
2979 */
2980function listenerAtPhase(id, event, propagationPhase) {
2981 var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
2982 return getListener(id, registrationName);
2983}
2984
2985/**
2986 * Tags a `SyntheticEvent` with dispatched listeners. Creating this function
2987 * here, allows us to not have to bind or create functions for each event.
2988 * Mutating the event's members allows us to not have to create a wrapping
2989 * "dispatch" object that pairs the event with the listener.
2990 */
2991function accumulateDirectionalDispatches(domID, upwards, event) {
2992 if ("development" !== 'production') {
2993 "development" !== 'production' ? warning(domID, 'Dispatching id must not be null') : undefined;
2994 }
2995 var phase = upwards ? PropagationPhases.bubbled : PropagationPhases.captured;
2996 var listener = listenerAtPhase(domID, event, phase);
2997 if (listener) {
2998 event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
2999 event._dispatchIDs = accumulateInto(event._dispatchIDs, domID);
3000 }
3001}
3002
3003/**
3004 * Collect dispatches (must be entirely collected before dispatching - see unit
3005 * tests). Lazily allocate the array to conserve memory. We must loop through
3006 * each event and perform the traversal for each one. We cannot perform a
3007 * single traversal for the entire collection of events because each event may
3008 * have a different target.
3009 */
3010function accumulateTwoPhaseDispatchesSingle(event) {
3011 if (event && event.dispatchConfig.phasedRegistrationNames) {
3012 EventPluginHub.injection.getInstanceHandle().traverseTwoPhase(event.dispatchMarker, accumulateDirectionalDispatches, event);
3013 }
3014}
3015
3016/**
3017 * Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID.
3018 */
3019function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
3020 if (event && event.dispatchConfig.phasedRegistrationNames) {
3021 EventPluginHub.injection.getInstanceHandle().traverseTwoPhaseSkipTarget(event.dispatchMarker, accumulateDirectionalDispatches, event);
3022 }
3023}
3024
3025/**
3026 * Accumulates without regard to direction, does not look for phased
3027 * registration names. Same as `accumulateDirectDispatchesSingle` but without
3028 * requiring that the `dispatchMarker` be the same as the dispatched ID.
3029 */
3030function accumulateDispatches(id, ignoredDirection, event) {
3031 if (event && event.dispatchConfig.registrationName) {
3032 var registrationName = event.dispatchConfig.registrationName;
3033 var listener = getListener(id, registrationName);
3034 if (listener) {
3035 event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
3036 event._dispatchIDs = accumulateInto(event._dispatchIDs, id);
3037 }
3038 }
3039}
3040
3041/**
3042 * Accumulates dispatches on an `SyntheticEvent`, but only for the
3043 * `dispatchMarker`.
3044 * @param {SyntheticEvent} event
3045 */
3046function accumulateDirectDispatchesSingle(event) {
3047 if (event && event.dispatchConfig.registrationName) {
3048 accumulateDispatches(event.dispatchMarker, null, event);
3049 }
3050}
3051
3052function accumulateTwoPhaseDispatches(events) {
3053 forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
3054}
3055
3056function accumulateTwoPhaseDispatchesSkipTarget(events) {
3057 forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget);
3058}
3059
3060function accumulateEnterLeaveDispatches(leave, enter, fromID, toID) {
3061 EventPluginHub.injection.getInstanceHandle().traverseEnterLeave(fromID, toID, accumulateDispatches, leave, enter);
3062}
3063
3064function accumulateDirectDispatches(events) {
3065 forEachAccumulated(events, accumulateDirectDispatchesSingle);
3066}
3067
3068/**
3069 * A small set of propagation patterns, each of which will accept a small amount
3070 * of information, and generate a set of "dispatch ready event objects" - which
3071 * are sets of events that have already been annotated with a set of dispatched
3072 * listener functions/ids. The API is designed this way to discourage these
3073 * propagation strategies from actually executing the dispatches, since we
3074 * always want to collect the entire set of dispatches before executing event a
3075 * single one.
3076 *
3077 * @constructor EventPropagators
3078 */
3079var EventPropagators = {
3080 accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches,
3081 accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget,
3082 accumulateDirectDispatches: accumulateDirectDispatches,
3083 accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches
3084};
3085
3086module.exports = EventPropagators;
3087},{"115":115,"124":124,"15":15,"16":16,"173":173}],20:[function(_dereq_,module,exports){
3088/**
3089 * Copyright 2013-2015, Facebook, Inc.
3090 * All rights reserved.
3091 *
3092 * This source code is licensed under the BSD-style license found in the
3093 * LICENSE file in the root directory of this source tree. An additional grant
3094 * of patent rights can be found in the PATENTS file in the same directory.
3095 *
3096 * @providesModule FallbackCompositionState
3097 * @typechecks static-only
3098 */
3099
3100'use strict';
3101
3102var PooledClass = _dereq_(25);
3103
3104var assign = _dereq_(24);
3105var getTextContentAccessor = _dereq_(131);
3106
3107/**
3108 * This helper class stores information about text content of a target node,
3109 * allowing comparison of content before and after a given event.
3110 *
3111 * Identify the node where selection currently begins, then observe
3112 * both its text content and its current position in the DOM. Since the
3113 * browser may natively replace the target node during composition, we can
3114 * use its position to find its replacement.
3115 *
3116 * @param {DOMEventTarget} root
3117 */
3118function FallbackCompositionState(root) {
3119 this._root = root;
3120 this._startText = this.getText();
3121 this._fallbackText = null;
3122}
3123
3124assign(FallbackCompositionState.prototype, {
3125 destructor: function () {
3126 this._root = null;
3127 this._startText = null;
3128 this._fallbackText = null;
3129 },
3130
3131 /**
3132 * Get current text of input.
3133 *
3134 * @return {string}
3135 */
3136 getText: function () {
3137 if ('value' in this._root) {
3138 return this._root.value;
3139 }
3140 return this._root[getTextContentAccessor()];
3141 },
3142
3143 /**
3144 * Determine the differing substring between the initially stored
3145 * text content and the current content.
3146 *
3147 * @return {string}
3148 */
3149 getData: function () {
3150 if (this._fallbackText) {
3151 return this._fallbackText;
3152 }
3153
3154 var start;
3155 var startValue = this._startText;
3156 var startLength = startValue.length;
3157 var end;
3158 var endValue = this.getText();
3159 var endLength = endValue.length;
3160
3161 for (start = 0; start < startLength; start++) {
3162 if (startValue[start] !== endValue[start]) {
3163 break;
3164 }
3165 }
3166
3167 var minEnd = startLength - start;
3168 for (end = 1; end <= minEnd; end++) {
3169 if (startValue[startLength - end] !== endValue[endLength - end]) {
3170 break;
3171 }
3172 }
3173
3174 var sliceTail = end > 1 ? 1 - end : undefined;
3175 this._fallbackText = endValue.slice(start, sliceTail);
3176 return this._fallbackText;
3177 }
3178});
3179
3180PooledClass.addPoolingTo(FallbackCompositionState);
3181
3182module.exports = FallbackCompositionState;
3183},{"131":131,"24":24,"25":25}],21:[function(_dereq_,module,exports){
3184/**
3185 * Copyright 2013-2015, Facebook, Inc.
3186 * All rights reserved.
3187 *
3188 * This source code is licensed under the BSD-style license found in the
3189 * LICENSE file in the root directory of this source tree. An additional grant
3190 * of patent rights can be found in the PATENTS file in the same directory.
3191 *
3192 * @providesModule HTMLDOMPropertyConfig
3193 */
3194
3195'use strict';
3196
3197var DOMProperty = _dereq_(10);
3198var ExecutionEnvironment = _dereq_(147);
3199
3200var MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE;
3201var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY;
3202var HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE;
3203var HAS_SIDE_EFFECTS = DOMProperty.injection.HAS_SIDE_EFFECTS;
3204var HAS_NUMERIC_VALUE = DOMProperty.injection.HAS_NUMERIC_VALUE;
3205var HAS_POSITIVE_NUMERIC_VALUE = DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE;
3206var HAS_OVERLOADED_BOOLEAN_VALUE = DOMProperty.injection.HAS_OVERLOADED_BOOLEAN_VALUE;
3207
3208var hasSVG;
3209if (ExecutionEnvironment.canUseDOM) {
3210 var implementation = document.implementation;
3211 hasSVG = implementation && implementation.hasFeature && implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#BasicStructure', '1.1');
3212}
3213
3214var HTMLDOMPropertyConfig = {
3215 isCustomAttribute: RegExp.prototype.test.bind(/^(data|aria)-[a-z_][a-z\d_.\-]*$/),
3216 Properties: {
3217 /**
3218 * Standard Properties
3219 */
3220 accept: null,
3221 acceptCharset: null,
3222 accessKey: null,
3223 action: null,
3224 allowFullScreen: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
3225 allowTransparency: MUST_USE_ATTRIBUTE,
3226 alt: null,
3227 async: HAS_BOOLEAN_VALUE,
3228 autoComplete: null,
3229 // autoFocus is polyfilled/normalized by AutoFocusUtils
3230 // autoFocus: HAS_BOOLEAN_VALUE,
3231 autoPlay: HAS_BOOLEAN_VALUE,
3232 capture: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
3233 cellPadding: null,
3234 cellSpacing: null,
3235 charSet: MUST_USE_ATTRIBUTE,
3236 challenge: MUST_USE_ATTRIBUTE,
3237 checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
3238 classID: MUST_USE_ATTRIBUTE,
3239 // To set className on SVG elements, it's necessary to use .setAttribute;
3240 // this works on HTML elements too in all browsers except IE8. Conveniently,
3241 // IE8 doesn't support SVG and so we can simply use the attribute in
3242 // browsers that support SVG and the property in browsers that don't,
3243 // regardless of whether the element is HTML or SVG.
3244 className: hasSVG ? MUST_USE_ATTRIBUTE : MUST_USE_PROPERTY,
3245 cols: MUST_USE_ATTRIBUTE | HAS_POSITIVE_NUMERIC_VALUE,
3246 colSpan: null,
3247 content: null,
3248 contentEditable: null,
3249 contextMenu: MUST_USE_ATTRIBUTE,
3250 controls: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
3251 coords: null,
3252 crossOrigin: null,
3253 data: null, // For `<object />` acts as `src`.
3254 dateTime: MUST_USE_ATTRIBUTE,
3255 'default': HAS_BOOLEAN_VALUE,
3256 defer: HAS_BOOLEAN_VALUE,
3257 dir: null,
3258 disabled: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
3259 download: HAS_OVERLOADED_BOOLEAN_VALUE,
3260 draggable: null,
3261 encType: null,
3262 form: MUST_USE_ATTRIBUTE,
3263 formAction: MUST_USE_ATTRIBUTE,
3264 formEncType: MUST_USE_ATTRIBUTE,
3265 formMethod: MUST_USE_ATTRIBUTE,
3266 formNoValidate: HAS_BOOLEAN_VALUE,
3267 formTarget: MUST_USE_ATTRIBUTE,
3268 frameBorder: MUST_USE_ATTRIBUTE,
3269 headers: null,
3270 height: MUST_USE_ATTRIBUTE,
3271 hidden: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
3272 high: null,
3273 href: null,
3274 hrefLang: null,
3275 htmlFor: null,
3276 httpEquiv: null,
3277 icon: null,
3278 id: MUST_USE_PROPERTY,
3279 inputMode: MUST_USE_ATTRIBUTE,
3280 integrity: null,
3281 is: MUST_USE_ATTRIBUTE,
3282 keyParams: MUST_USE_ATTRIBUTE,
3283 keyType: MUST_USE_ATTRIBUTE,
3284 kind: null,
3285 label: null,
3286 lang: null,
3287 list: MUST_USE_ATTRIBUTE,
3288 loop: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
3289 low: null,
3290 manifest: MUST_USE_ATTRIBUTE,
3291 marginHeight: null,
3292 marginWidth: null,
3293 max: null,
3294 maxLength: MUST_USE_ATTRIBUTE,
3295 media: MUST_USE_ATTRIBUTE,
3296 mediaGroup: null,
3297 method: null,
3298 min: null,
3299 minLength: MUST_USE_ATTRIBUTE,
3300 multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
3301 muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
3302 name: null,
3303 nonce: MUST_USE_ATTRIBUTE,
3304 noValidate: HAS_BOOLEAN_VALUE,
3305 open: HAS_BOOLEAN_VALUE,
3306 optimum: null,
3307 pattern: null,
3308 placeholder: null,
3309 poster: null,
3310 preload: null,
3311 radioGroup: null,
3312 readOnly: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
3313 rel: null,
3314 required: HAS_BOOLEAN_VALUE,
3315 reversed: HAS_BOOLEAN_VALUE,
3316 role: MUST_USE_ATTRIBUTE,
3317 rows: MUST_USE_ATTRIBUTE | HAS_POSITIVE_NUMERIC_VALUE,
3318 rowSpan: null,
3319 sandbox: null,
3320 scope: null,
3321 scoped: HAS_BOOLEAN_VALUE,
3322 scrolling: null,
3323 seamless: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
3324 selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
3325 shape: null,
3326 size: MUST_USE_ATTRIBUTE | HAS_POSITIVE_NUMERIC_VALUE,
3327 sizes: MUST_USE_ATTRIBUTE,
3328 span: HAS_POSITIVE_NUMERIC_VALUE,
3329 spellCheck: null,
3330 src: null,
3331 srcDoc: MUST_USE_PROPERTY,
3332 srcLang: null,
3333 srcSet: MUST_USE_ATTRIBUTE,
3334 start: HAS_NUMERIC_VALUE,
3335 step: null,
3336 style: null,
3337 summary: null,
3338 tabIndex: null,
3339 target: null,
3340 title: null,
3341 type: null,
3342 useMap: null,
3343 value: MUST_USE_PROPERTY | HAS_SIDE_EFFECTS,
3344 width: MUST_USE_ATTRIBUTE,
3345 wmode: MUST_USE_ATTRIBUTE,
3346 wrap: null,
3347
3348 /**
3349 * RDFa Properties
3350 */
3351 about: MUST_USE_ATTRIBUTE,
3352 datatype: MUST_USE_ATTRIBUTE,
3353 inlist: MUST_USE_ATTRIBUTE,
3354 prefix: MUST_USE_ATTRIBUTE,
3355 // property is also supported for OpenGraph in meta tags.
3356 property: MUST_USE_ATTRIBUTE,
3357 resource: MUST_USE_ATTRIBUTE,
3358 'typeof': MUST_USE_ATTRIBUTE,
3359 vocab: MUST_USE_ATTRIBUTE,
3360
3361 /**
3362 * Non-standard Properties
3363 */
3364 // autoCapitalize and autoCorrect are supported in Mobile Safari for
3365 // keyboard hints.
3366 autoCapitalize: null,
3367 autoCorrect: null,
3368 // autoSave allows WebKit/Blink to persist values of input fields on page reloads
3369 autoSave: null,
3370 // color is for Safari mask-icon link
3371 color: null,
3372 // itemProp, itemScope, itemType are for
3373 // Microdata support. See http://schema.org/docs/gs.html
3374 itemProp: MUST_USE_ATTRIBUTE,
3375 itemScope: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
3376 itemType: MUST_USE_ATTRIBUTE,
3377 // itemID and itemRef are for Microdata support as well but
3378 // only specified in the the WHATWG spec document. See
3379 // https://html.spec.whatwg.org/multipage/microdata.html#microdata-dom-api
3380 itemID: MUST_USE_ATTRIBUTE,
3381 itemRef: MUST_USE_ATTRIBUTE,
3382 // results show looking glass icon and recent searches on input
3383 // search fields in WebKit/Blink
3384 results: null,
3385 // IE-only attribute that specifies security restrictions on an iframe
3386 // as an alternative to the sandbox attribute on IE<10
3387 security: MUST_USE_ATTRIBUTE,
3388 // IE-only attribute that controls focus behavior
3389 unselectable: MUST_USE_ATTRIBUTE
3390 },
3391 DOMAttributeNames: {
3392 acceptCharset: 'accept-charset',
3393 className: 'class',
3394 htmlFor: 'for',
3395 httpEquiv: 'http-equiv'
3396 },
3397 DOMPropertyNames: {
3398 autoCapitalize: 'autocapitalize',
3399 autoComplete: 'autocomplete',
3400 autoCorrect: 'autocorrect',
3401 autoFocus: 'autofocus',
3402 autoPlay: 'autoplay',
3403 autoSave: 'autosave',
3404 // `encoding` is equivalent to `enctype`, IE8 lacks an `enctype` setter.
3405 // http://www.w3.org/TR/html5/forms.html#dom-fs-encoding
3406 encType: 'encoding',
3407 hrefLang: 'hreflang',
3408 radioGroup: 'radiogroup',
3409 spellCheck: 'spellcheck',
3410 srcDoc: 'srcdoc',
3411 srcSet: 'srcset'
3412 }
3413};
3414
3415module.exports = HTMLDOMPropertyConfig;
3416},{"10":10,"147":147}],22:[function(_dereq_,module,exports){
3417/**
3418 * Copyright 2013-2015, Facebook, Inc.
3419 * All rights reserved.
3420 *
3421 * This source code is licensed under the BSD-style license found in the
3422 * LICENSE file in the root directory of this source tree. An additional grant
3423 * of patent rights can be found in the PATENTS file in the same directory.
3424 *
3425 * @providesModule LinkedStateMixin
3426 * @typechecks static-only
3427 */
3428
3429'use strict';
3430
3431var ReactLink = _dereq_(70);
3432var ReactStateSetters = _dereq_(90);
3433
3434/**
3435 * A simple mixin around ReactLink.forState().
3436 */
3437var LinkedStateMixin = {
3438 /**
3439 * Create a ReactLink that's linked to part of this component's state. The
3440 * ReactLink will have the current value of this.state[key] and will call
3441 * setState() when a change is requested.
3442 *
3443 * @param {string} key state key to update. Note: you may want to use keyOf()
3444 * if you're using Google Closure Compiler advanced mode.
3445 * @return {ReactLink} ReactLink instance linking to the state.
3446 */
3447 linkState: function (key) {
3448 return new ReactLink(this.state[key], ReactStateSetters.createStateKeySetter(this, key));
3449 }
3450};
3451
3452module.exports = LinkedStateMixin;
3453},{"70":70,"90":90}],23:[function(_dereq_,module,exports){
3454/**
3455 * Copyright 2013-2015, Facebook, Inc.
3456 * All rights reserved.
3457 *
3458 * This source code is licensed under the BSD-style license found in the
3459 * LICENSE file in the root directory of this source tree. An additional grant
3460 * of patent rights can be found in the PATENTS file in the same directory.
3461 *
3462 * @providesModule LinkedValueUtils
3463 * @typechecks static-only
3464 */
3465
3466'use strict';
3467
3468var ReactPropTypes = _dereq_(82);
3469var ReactPropTypeLocations = _dereq_(81);
3470
3471var invariant = _dereq_(161);
3472var warning = _dereq_(173);
3473
3474var hasReadOnlyValue = {
3475 'button': true,
3476 'checkbox': true,
3477 'image': true,
3478 'hidden': true,
3479 'radio': true,
3480 'reset': true,
3481 'submit': true
3482};
3483
3484function _assertSingleLink(inputProps) {
3485 !(inputProps.checkedLink == null || inputProps.valueLink == null) ? "development" !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a valueLink. If you want to use ' + 'checkedLink, you probably don\'t want to use valueLink and vice versa.') : invariant(false) : undefined;
3486}
3487function _assertValueLink(inputProps) {
3488 _assertSingleLink(inputProps);
3489 !(inputProps.value == null && inputProps.onChange == null) ? "development" !== 'production' ? invariant(false, 'Cannot provide a valueLink and a value or onChange event. If you want ' + 'to use value or onChange, you probably don\'t want to use valueLink.') : invariant(false) : undefined;
3490}
3491
3492function _assertCheckedLink(inputProps) {
3493 _assertSingleLink(inputProps);
3494 !(inputProps.checked == null && inputProps.onChange == null) ? "development" !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a checked property or onChange event. ' + 'If you want to use checked or onChange, you probably don\'t want to ' + 'use checkedLink') : invariant(false) : undefined;
3495}
3496
3497var propTypes = {
3498 value: function (props, propName, componentName) {
3499 if (!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled) {
3500 return null;
3501 }
3502 return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
3503 },
3504 checked: function (props, propName, componentName) {
3505 if (!props[propName] || props.onChange || props.readOnly || props.disabled) {
3506 return null;
3507 }
3508 return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
3509 },
3510 onChange: ReactPropTypes.func
3511};
3512
3513var loggedTypeFailures = {};
3514function getDeclarationErrorAddendum(owner) {
3515 if (owner) {
3516 var name = owner.getName();
3517 if (name) {
3518 return ' Check the render method of `' + name + '`.';
3519 }
3520 }
3521 return '';
3522}
3523
3524/**
3525 * Provide a linked `value` attribute for controlled forms. You should not use
3526 * this outside of the ReactDOM controlled form components.
3527 */
3528var LinkedValueUtils = {
3529 checkPropTypes: function (tagName, props, owner) {
3530 for (var propName in propTypes) {
3531 if (propTypes.hasOwnProperty(propName)) {
3532 var error = propTypes[propName](props, propName, tagName, ReactPropTypeLocations.prop);
3533 }
3534 if (error instanceof Error && !(error.message in loggedTypeFailures)) {
3535 // Only monitor this failure once because there tends to be a lot of the
3536 // same error.
3537 loggedTypeFailures[error.message] = true;
3538
3539 var addendum = getDeclarationErrorAddendum(owner);
3540 "development" !== 'production' ? warning(false, 'Failed form propType: %s%s', error.message, addendum) : undefined;
3541 }
3542 }
3543 },
3544
3545 /**
3546 * @param {object} inputProps Props for form component
3547 * @return {*} current value of the input either from value prop or link.
3548 */
3549 getValue: function (inputProps) {
3550 if (inputProps.valueLink) {
3551 _assertValueLink(inputProps);
3552 return inputProps.valueLink.value;
3553 }
3554 return inputProps.value;
3555 },
3556
3557 /**
3558 * @param {object} inputProps Props for form component
3559 * @return {*} current checked status of the input either from checked prop
3560 * or link.
3561 */
3562 getChecked: function (inputProps) {
3563 if (inputProps.checkedLink) {
3564 _assertCheckedLink(inputProps);
3565 return inputProps.checkedLink.value;
3566 }
3567 return inputProps.checked;
3568 },
3569
3570 /**
3571 * @param {object} inputProps Props for form component
3572 * @param {SyntheticEvent} event change event to handle
3573 */
3574 executeOnChange: function (inputProps, event) {
3575 if (inputProps.valueLink) {
3576 _assertValueLink(inputProps);
3577 return inputProps.valueLink.requestChange(event.target.value);
3578 } else if (inputProps.checkedLink) {
3579 _assertCheckedLink(inputProps);
3580 return inputProps.checkedLink.requestChange(event.target.checked);
3581 } else if (inputProps.onChange) {
3582 return inputProps.onChange.call(undefined, event);
3583 }
3584 }
3585};
3586
3587module.exports = LinkedValueUtils;
3588},{"161":161,"173":173,"81":81,"82":82}],24:[function(_dereq_,module,exports){
3589/**
3590 * Copyright 2014-2015, Facebook, Inc.
3591 * All rights reserved.
3592 *
3593 * This source code is licensed under the BSD-style license found in the
3594 * LICENSE file in the root directory of this source tree. An additional grant
3595 * of patent rights can be found in the PATENTS file in the same directory.
3596 *
3597 * @providesModule Object.assign
3598 */
3599
3600// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign
3601
3602'use strict';
3603
3604function assign(target, sources) {
3605 if (target == null) {
3606 throw new TypeError('Object.assign target cannot be null or undefined');
3607 }
3608
3609 var to = Object(target);
3610 var hasOwnProperty = Object.prototype.hasOwnProperty;
3611
3612 for (var nextIndex = 1; nextIndex < arguments.length; nextIndex++) {
3613 var nextSource = arguments[nextIndex];
3614 if (nextSource == null) {
3615 continue;
3616 }
3617
3618 var from = Object(nextSource);
3619
3620 // We don't currently support accessors nor proxies. Therefore this
3621 // copy cannot throw. If we ever supported this then we must handle
3622 // exceptions and side-effects. We don't support symbols so they won't
3623 // be transferred.
3624
3625 for (var key in from) {
3626 if (hasOwnProperty.call(from, key)) {
3627 to[key] = from[key];
3628 }
3629 }
3630 }
3631
3632 return to;
3633}
3634
3635module.exports = assign;
3636},{}],25:[function(_dereq_,module,exports){
3637/**
3638 * Copyright 2013-2015, Facebook, Inc.
3639 * All rights reserved.
3640 *
3641 * This source code is licensed under the BSD-style license found in the
3642 * LICENSE file in the root directory of this source tree. An additional grant
3643 * of patent rights can be found in the PATENTS file in the same directory.
3644 *
3645 * @providesModule PooledClass
3646 */
3647
3648'use strict';
3649
3650var invariant = _dereq_(161);
3651
3652/**
3653 * Static poolers. Several custom versions for each potential number of
3654 * arguments. A completely generic pooler is easy to implement, but would
3655 * require accessing the `arguments` object. In each of these, `this` refers to
3656 * the Class itself, not an instance. If any others are needed, simply add them
3657 * here, or in their own files.
3658 */
3659var oneArgumentPooler = function (copyFieldsFrom) {
3660 var Klass = this;
3661 if (Klass.instancePool.length) {
3662 var instance = Klass.instancePool.pop();
3663 Klass.call(instance, copyFieldsFrom);
3664 return instance;
3665 } else {
3666 return new Klass(copyFieldsFrom);
3667 }
3668};
3669
3670var twoArgumentPooler = function (a1, a2) {
3671 var Klass = this;
3672 if (Klass.instancePool.length) {
3673 var instance = Klass.instancePool.pop();
3674 Klass.call(instance, a1, a2);
3675 return instance;
3676 } else {
3677 return new Klass(a1, a2);
3678 }
3679};
3680
3681var threeArgumentPooler = function (a1, a2, a3) {
3682 var Klass = this;
3683 if (Klass.instancePool.length) {
3684 var instance = Klass.instancePool.pop();
3685 Klass.call(instance, a1, a2, a3);
3686 return instance;
3687 } else {
3688 return new Klass(a1, a2, a3);
3689 }
3690};
3691
3692var fourArgumentPooler = function (a1, a2, a3, a4) {
3693 var Klass = this;
3694 if (Klass.instancePool.length) {
3695 var instance = Klass.instancePool.pop();
3696 Klass.call(instance, a1, a2, a3, a4);
3697 return instance;
3698 } else {
3699 return new Klass(a1, a2, a3, a4);
3700 }
3701};
3702
3703var fiveArgumentPooler = function (a1, a2, a3, a4, a5) {
3704 var Klass = this;
3705 if (Klass.instancePool.length) {
3706 var instance = Klass.instancePool.pop();
3707 Klass.call(instance, a1, a2, a3, a4, a5);
3708 return instance;
3709 } else {
3710 return new Klass(a1, a2, a3, a4, a5);
3711 }
3712};
3713
3714var standardReleaser = function (instance) {
3715 var Klass = this;
3716 !(instance instanceof Klass) ? "development" !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : invariant(false) : undefined;
3717 instance.destructor();
3718 if (Klass.instancePool.length < Klass.poolSize) {
3719 Klass.instancePool.push(instance);
3720 }
3721};
3722
3723var DEFAULT_POOL_SIZE = 10;
3724var DEFAULT_POOLER = oneArgumentPooler;
3725
3726/**
3727 * Augments `CopyConstructor` to be a poolable class, augmenting only the class
3728 * itself (statically) not adding any prototypical fields. Any CopyConstructor
3729 * you give this may have a `poolSize` property, and will look for a
3730 * prototypical `destructor` on instances (optional).
3731 *
3732 * @param {Function} CopyConstructor Constructor that can be used to reset.
3733 * @param {Function} pooler Customizable pooler.
3734 */
3735var addPoolingTo = function (CopyConstructor, pooler) {
3736 var NewKlass = CopyConstructor;
3737 NewKlass.instancePool = [];
3738 NewKlass.getPooled = pooler || DEFAULT_POOLER;
3739 if (!NewKlass.poolSize) {
3740 NewKlass.poolSize = DEFAULT_POOL_SIZE;
3741 }
3742 NewKlass.release = standardReleaser;
3743 return NewKlass;
3744};
3745
3746var PooledClass = {
3747 addPoolingTo: addPoolingTo,
3748 oneArgumentPooler: oneArgumentPooler,
3749 twoArgumentPooler: twoArgumentPooler,
3750 threeArgumentPooler: threeArgumentPooler,
3751 fourArgumentPooler: fourArgumentPooler,
3752 fiveArgumentPooler: fiveArgumentPooler
3753};
3754
3755module.exports = PooledClass;
3756},{"161":161}],26:[function(_dereq_,module,exports){
3757/**
3758 * Copyright 2013-2015, Facebook, Inc.
3759 * All rights reserved.
3760 *
3761 * This source code is licensed under the BSD-style license found in the
3762 * LICENSE file in the root directory of this source tree. An additional grant
3763 * of patent rights can be found in the PATENTS file in the same directory.
3764 *
3765 * @providesModule React
3766 */
3767
3768'use strict';
3769
3770var ReactDOM = _dereq_(40);
3771var ReactDOMServer = _dereq_(50);
3772var ReactIsomorphic = _dereq_(69);
3773
3774var assign = _dereq_(24);
3775var deprecated = _dereq_(120);
3776
3777// `version` will be added here by ReactIsomorphic.
3778var React = {};
3779
3780assign(React, ReactIsomorphic);
3781
3782assign(React, {
3783 // ReactDOM
3784 findDOMNode: deprecated('findDOMNode', 'ReactDOM', 'react-dom', ReactDOM, ReactDOM.findDOMNode),
3785 render: deprecated('render', 'ReactDOM', 'react-dom', ReactDOM, ReactDOM.render),
3786 unmountComponentAtNode: deprecated('unmountComponentAtNode', 'ReactDOM', 'react-dom', ReactDOM, ReactDOM.unmountComponentAtNode),
3787
3788 // ReactDOMServer
3789 renderToString: deprecated('renderToString', 'ReactDOMServer', 'react-dom/server', ReactDOMServer, ReactDOMServer.renderToString),
3790 renderToStaticMarkup: deprecated('renderToStaticMarkup', 'ReactDOMServer', 'react-dom/server', ReactDOMServer, ReactDOMServer.renderToStaticMarkup)
3791});
3792
3793React.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactDOM;
3794React.__SECRET_DOM_SERVER_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactDOMServer;
3795
3796module.exports = React;
3797},{"120":120,"24":24,"40":40,"50":50,"69":69}],27:[function(_dereq_,module,exports){
3798/**
3799 * Copyright 2013-2015, Facebook, Inc.
3800 * All rights reserved.
3801 *
3802 * This source code is licensed under the BSD-style license found in the
3803 * LICENSE file in the root directory of this source tree. An additional grant
3804 * of patent rights can be found in the PATENTS file in the same directory.
3805 *
3806 * @providesModule ReactBrowserComponentMixin
3807 */
3808
3809'use strict';
3810
3811var ReactInstanceMap = _dereq_(68);
3812
3813var findDOMNode = _dereq_(122);
3814var warning = _dereq_(173);
3815
3816var didWarnKey = '_getDOMNodeDidWarn';
3817
3818var ReactBrowserComponentMixin = {
3819 /**
3820 * Returns the DOM node rendered by this component.
3821 *
3822 * @return {DOMElement} The root node of this component.
3823 * @final
3824 * @protected
3825 */
3826 getDOMNode: function () {
3827 "development" !== 'production' ? warning(this.constructor[didWarnKey], '%s.getDOMNode(...) is deprecated. Please use ' + 'ReactDOM.findDOMNode(instance) instead.', ReactInstanceMap.get(this).getName() || this.tagName || 'Unknown') : undefined;
3828 this.constructor[didWarnKey] = true;
3829 return findDOMNode(this);
3830 }
3831};
3832
3833module.exports = ReactBrowserComponentMixin;
3834},{"122":122,"173":173,"68":68}],28:[function(_dereq_,module,exports){
3835/**
3836 * Copyright 2013-2015, Facebook, Inc.
3837 * All rights reserved.
3838 *
3839 * This source code is licensed under the BSD-style license found in the
3840 * LICENSE file in the root directory of this source tree. An additional grant
3841 * of patent rights can be found in the PATENTS file in the same directory.
3842 *
3843 * @providesModule ReactBrowserEventEmitter
3844 * @typechecks static-only
3845 */
3846
3847'use strict';
3848
3849var EventConstants = _dereq_(15);
3850var EventPluginHub = _dereq_(16);
3851var EventPluginRegistry = _dereq_(17);
3852var ReactEventEmitterMixin = _dereq_(62);
3853var ReactPerf = _dereq_(78);
3854var ViewportMetrics = _dereq_(114);
3855
3856var assign = _dereq_(24);
3857var isEventSupported = _dereq_(133);
3858
3859/**
3860 * Summary of `ReactBrowserEventEmitter` event handling:
3861 *
3862 * - Top-level delegation is used to trap most native browser events. This
3863 * may only occur in the main thread and is the responsibility of
3864 * ReactEventListener, which is injected and can therefore support pluggable
3865 * event sources. This is the only work that occurs in the main thread.
3866 *
3867 * - We normalize and de-duplicate events to account for browser quirks. This
3868 * may be done in the worker thread.
3869 *
3870 * - Forward these native events (with the associated top-level type used to
3871 * trap it) to `EventPluginHub`, which in turn will ask plugins if they want
3872 * to extract any synthetic events.
3873 *
3874 * - The `EventPluginHub` will then process each event by annotating them with
3875 * "dispatches", a sequence of listeners and IDs that care about that event.
3876 *
3877 * - The `EventPluginHub` then dispatches the events.
3878 *
3879 * Overview of React and the event system:
3880 *
3881 * +------------+ .
3882 * | DOM | .
3883 * +------------+ .
3884 * | .
3885 * v .
3886 * +------------+ .
3887 * | ReactEvent | .
3888 * | Listener | .
3889 * +------------+ . +-----------+
3890 * | . +--------+|SimpleEvent|
3891 * | . | |Plugin |
3892 * +-----|------+ . v +-----------+
3893 * | | | . +--------------+ +------------+
3894 * | +-----------.--->|EventPluginHub| | Event |
3895 * | | . | | +-----------+ | Propagators|
3896 * | ReactEvent | . | | |TapEvent | |------------|
3897 * | Emitter | . | |<---+|Plugin | |other plugin|
3898 * | | . | | +-----------+ | utilities |
3899 * | +-----------.--->| | +------------+
3900 * | | | . +--------------+
3901 * +-----|------+ . ^ +-----------+
3902 * | . | |Enter/Leave|
3903 * + . +-------+|Plugin |
3904 * +-------------+ . +-----------+
3905 * | application | .
3906 * |-------------| .
3907 * | | .
3908 * | | .
3909 * +-------------+ .
3910 * .
3911 * React Core . General Purpose Event Plugin System
3912 */
3913
3914var alreadyListeningTo = {};
3915var isMonitoringScrollValue = false;
3916var reactTopListenersCounter = 0;
3917
3918// For events like 'submit' which don't consistently bubble (which we trap at a
3919// lower node than `document`), binding at `document` would cause duplicate
3920// events so we don't include them here
3921var topEventMapping = {
3922 topAbort: 'abort',
3923 topBlur: 'blur',
3924 topCanPlay: 'canplay',
3925 topCanPlayThrough: 'canplaythrough',
3926 topChange: 'change',
3927 topClick: 'click',
3928 topCompositionEnd: 'compositionend',
3929 topCompositionStart: 'compositionstart',
3930 topCompositionUpdate: 'compositionupdate',
3931 topContextMenu: 'contextmenu',
3932 topCopy: 'copy',
3933 topCut: 'cut',
3934 topDoubleClick: 'dblclick',
3935 topDrag: 'drag',
3936 topDragEnd: 'dragend',
3937 topDragEnter: 'dragenter',
3938 topDragExit: 'dragexit',
3939 topDragLeave: 'dragleave',
3940 topDragOver: 'dragover',
3941 topDragStart: 'dragstart',
3942 topDrop: 'drop',
3943 topDurationChange: 'durationchange',
3944 topEmptied: 'emptied',
3945 topEncrypted: 'encrypted',
3946 topEnded: 'ended',
3947 topError: 'error',
3948 topFocus: 'focus',
3949 topInput: 'input',
3950 topKeyDown: 'keydown',
3951 topKeyPress: 'keypress',
3952 topKeyUp: 'keyup',
3953 topLoadedData: 'loadeddata',
3954 topLoadedMetadata: 'loadedmetadata',
3955 topLoadStart: 'loadstart',
3956 topMouseDown: 'mousedown',
3957 topMouseMove: 'mousemove',
3958 topMouseOut: 'mouseout',
3959 topMouseOver: 'mouseover',
3960 topMouseUp: 'mouseup',
3961 topPaste: 'paste',
3962 topPause: 'pause',
3963 topPlay: 'play',
3964 topPlaying: 'playing',
3965 topProgress: 'progress',
3966 topRateChange: 'ratechange',
3967 topScroll: 'scroll',
3968 topSeeked: 'seeked',
3969 topSeeking: 'seeking',
3970 topSelectionChange: 'selectionchange',
3971 topStalled: 'stalled',
3972 topSuspend: 'suspend',
3973 topTextInput: 'textInput',
3974 topTimeUpdate: 'timeupdate',
3975 topTouchCancel: 'touchcancel',
3976 topTouchEnd: 'touchend',
3977 topTouchMove: 'touchmove',
3978 topTouchStart: 'touchstart',
3979 topVolumeChange: 'volumechange',
3980 topWaiting: 'waiting',
3981 topWheel: 'wheel'
3982};
3983
3984/**
3985 * To ensure no conflicts with other potential React instances on the page
3986 */
3987var topListenersIDKey = '_reactListenersID' + String(Math.random()).slice(2);
3988
3989function getListeningForDocument(mountAt) {
3990 // In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty`
3991 // directly.
3992 if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) {
3993 mountAt[topListenersIDKey] = reactTopListenersCounter++;
3994 alreadyListeningTo[mountAt[topListenersIDKey]] = {};
3995 }
3996 return alreadyListeningTo[mountAt[topListenersIDKey]];
3997}
3998
3999/**
4000 * `ReactBrowserEventEmitter` is used to attach top-level event listeners. For
4001 * example:
4002 *
4003 * ReactBrowserEventEmitter.putListener('myID', 'onClick', myFunction);
4004 *
4005 * This would allocate a "registration" of `('onClick', myFunction)` on 'myID'.
4006 *
4007 * @internal
4008 */
4009var ReactBrowserEventEmitter = assign({}, ReactEventEmitterMixin, {
4010
4011 /**
4012 * Injectable event backend
4013 */
4014 ReactEventListener: null,
4015
4016 injection: {
4017 /**
4018 * @param {object} ReactEventListener
4019 */
4020 injectReactEventListener: function (ReactEventListener) {
4021 ReactEventListener.setHandleTopLevel(ReactBrowserEventEmitter.handleTopLevel);
4022 ReactBrowserEventEmitter.ReactEventListener = ReactEventListener;
4023 }
4024 },
4025
4026 /**
4027 * Sets whether or not any created callbacks should be enabled.
4028 *
4029 * @param {boolean} enabled True if callbacks should be enabled.
4030 */
4031 setEnabled: function (enabled) {
4032 if (ReactBrowserEventEmitter.ReactEventListener) {
4033 ReactBrowserEventEmitter.ReactEventListener.setEnabled(enabled);
4034 }
4035 },
4036
4037 /**
4038 * @return {boolean} True if callbacks are enabled.
4039 */
4040 isEnabled: function () {
4041 return !!(ReactBrowserEventEmitter.ReactEventListener && ReactBrowserEventEmitter.ReactEventListener.isEnabled());
4042 },
4043
4044 /**
4045 * We listen for bubbled touch events on the document object.
4046 *
4047 * Firefox v8.01 (and possibly others) exhibited strange behavior when
4048 * mounting `onmousemove` events at some node that was not the document
4049 * element. The symptoms were that if your mouse is not moving over something
4050 * contained within that mount point (for example on the background) the
4051 * top-level listeners for `onmousemove` won't be called. However, if you
4052 * register the `mousemove` on the document object, then it will of course
4053 * catch all `mousemove`s. This along with iOS quirks, justifies restricting
4054 * top-level listeners to the document object only, at least for these
4055 * movement types of events and possibly all events.
4056 *
4057 * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
4058 *
4059 * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but
4060 * they bubble to document.
4061 *
4062 * @param {string} registrationName Name of listener (e.g. `onClick`).
4063 * @param {object} contentDocumentHandle Document which owns the container
4064 */
4065 listenTo: function (registrationName, contentDocumentHandle) {
4066 var mountAt = contentDocumentHandle;
4067 var isListening = getListeningForDocument(mountAt);
4068 var dependencies = EventPluginRegistry.registrationNameDependencies[registrationName];
4069
4070 var topLevelTypes = EventConstants.topLevelTypes;
4071 for (var i = 0; i < dependencies.length; i++) {
4072 var dependency = dependencies[i];
4073 if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) {
4074 if (dependency === topLevelTypes.topWheel) {
4075 if (isEventSupported('wheel')) {
4076 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'wheel', mountAt);
4077 } else if (isEventSupported('mousewheel')) {
4078 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'mousewheel', mountAt);
4079 } else {
4080 // Firefox needs to capture a different mouse scroll event.
4081 // @see http://www.quirksmode.org/dom/events/tests/scroll.html
4082 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'DOMMouseScroll', mountAt);
4083 }
4084 } else if (dependency === topLevelTypes.topScroll) {
4085
4086 if (isEventSupported('scroll', true)) {
4087 ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topScroll, 'scroll', mountAt);
4088 } else {
4089 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topScroll, 'scroll', ReactBrowserEventEmitter.ReactEventListener.WINDOW_HANDLE);
4090 }
4091 } else if (dependency === topLevelTypes.topFocus || dependency === topLevelTypes.topBlur) {
4092
4093 if (isEventSupported('focus', true)) {
4094 ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topFocus, 'focus', mountAt);
4095 ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topBlur, 'blur', mountAt);
4096 } else if (isEventSupported('focusin')) {
4097 // IE has `focusin` and `focusout` events which bubble.
4098 // @see http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html
4099 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topFocus, 'focusin', mountAt);
4100 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topBlur, 'focusout', mountAt);
4101 }
4102
4103 // to make sure blur and focus event listeners are only attached once
4104 isListening[topLevelTypes.topBlur] = true;
4105 isListening[topLevelTypes.topFocus] = true;
4106 } else if (topEventMapping.hasOwnProperty(dependency)) {
4107 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(dependency, topEventMapping[dependency], mountAt);
4108 }
4109
4110 isListening[dependency] = true;
4111 }
4112 }
4113 },
4114
4115 trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {
4116 return ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelType, handlerBaseName, handle);
4117 },
4118
4119 trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {
4120 return ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelType, handlerBaseName, handle);
4121 },
4122
4123 /**
4124 * Listens to window scroll and resize events. We cache scroll values so that
4125 * application code can access them without triggering reflows.
4126 *
4127 * NOTE: Scroll events do not bubble.
4128 *
4129 * @see http://www.quirksmode.org/dom/events/scroll.html
4130 */
4131 ensureScrollValueMonitoring: function () {
4132 if (!isMonitoringScrollValue) {
4133 var refresh = ViewportMetrics.refreshScrollValues;
4134 ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(refresh);
4135 isMonitoringScrollValue = true;
4136 }
4137 },
4138
4139 eventNameDispatchConfigs: EventPluginHub.eventNameDispatchConfigs,
4140
4141 registrationNameModules: EventPluginHub.registrationNameModules,
4142
4143 putListener: EventPluginHub.putListener,
4144
4145 getListener: EventPluginHub.getListener,
4146
4147 deleteListener: EventPluginHub.deleteListener,
4148
4149 deleteAllListeners: EventPluginHub.deleteAllListeners
4150
4151});
4152
4153ReactPerf.measureMethods(ReactBrowserEventEmitter, 'ReactBrowserEventEmitter', {
4154 putListener: 'putListener',
4155 deleteListener: 'deleteListener'
4156});
4157
4158module.exports = ReactBrowserEventEmitter;
4159},{"114":114,"133":133,"15":15,"16":16,"17":17,"24":24,"62":62,"78":78}],29:[function(_dereq_,module,exports){
4160/**
4161 * Copyright 2013-2015, Facebook, Inc.
4162 * All rights reserved.
4163 *
4164 * This source code is licensed under the BSD-style license found in the
4165 * LICENSE file in the root directory of this source tree. An additional grant
4166 * of patent rights can be found in the PATENTS file in the same directory.
4167 *
4168 * @typechecks
4169 * @providesModule ReactCSSTransitionGroup
4170 */
4171
4172'use strict';
4173
4174var React = _dereq_(26);
4175
4176var assign = _dereq_(24);
4177
4178var ReactTransitionGroup = _dereq_(94);
4179var ReactCSSTransitionGroupChild = _dereq_(30);
4180
4181function createTransitionTimeoutPropValidator(transitionType) {
4182 var timeoutPropName = 'transition' + transitionType + 'Timeout';
4183 var enabledPropName = 'transition' + transitionType;
4184
4185 return function (props) {
4186 // If the transition is enabled
4187 if (props[enabledPropName]) {
4188 // If no timeout duration is provided
4189 if (props[timeoutPropName] == null) {
4190 return new Error(timeoutPropName + ' wasn\'t supplied to ReactCSSTransitionGroup: ' + 'this can cause unreliable animations and won\'t be supported in ' + 'a future version of React. See ' + 'https://fb.me/react-animation-transition-group-timeout for more ' + 'information.');
4191
4192 // If the duration isn't a number
4193 } else if (typeof props[timeoutPropName] !== 'number') {
4194 return new Error(timeoutPropName + ' must be a number (in milliseconds)');
4195 }
4196 }
4197 };
4198}
4199
4200var ReactCSSTransitionGroup = React.createClass({
4201 displayName: 'ReactCSSTransitionGroup',
4202
4203 propTypes: {
4204 transitionName: ReactCSSTransitionGroupChild.propTypes.name,
4205
4206 transitionAppear: React.PropTypes.bool,
4207 transitionEnter: React.PropTypes.bool,
4208 transitionLeave: React.PropTypes.bool,
4209 transitionAppearTimeout: createTransitionTimeoutPropValidator('Appear'),
4210 transitionEnterTimeout: createTransitionTimeoutPropValidator('Enter'),
4211 transitionLeaveTimeout: createTransitionTimeoutPropValidator('Leave')
4212 },
4213
4214 getDefaultProps: function () {
4215 return {
4216 transitionAppear: false,
4217 transitionEnter: true,
4218 transitionLeave: true
4219 };
4220 },
4221
4222 _wrapChild: function (child) {
4223 // We need to provide this childFactory so that
4224 // ReactCSSTransitionGroupChild can receive updates to name, enter, and
4225 // leave while it is leaving.
4226 return React.createElement(ReactCSSTransitionGroupChild, {
4227 name: this.props.transitionName,
4228 appear: this.props.transitionAppear,
4229 enter: this.props.transitionEnter,
4230 leave: this.props.transitionLeave,
4231 appearTimeout: this.props.transitionAppearTimeout,
4232 enterTimeout: this.props.transitionEnterTimeout,
4233 leaveTimeout: this.props.transitionLeaveTimeout
4234 }, child);
4235 },
4236
4237 render: function () {
4238 return React.createElement(ReactTransitionGroup, assign({}, this.props, { childFactory: this._wrapChild }));
4239 }
4240});
4241
4242module.exports = ReactCSSTransitionGroup;
4243},{"24":24,"26":26,"30":30,"94":94}],30:[function(_dereq_,module,exports){
4244/**
4245 * Copyright 2013-2015, Facebook, Inc.
4246 * All rights reserved.
4247 *
4248 * This source code is licensed under the BSD-style license found in the
4249 * LICENSE file in the root directory of this source tree. An additional grant
4250 * of patent rights can be found in the PATENTS file in the same directory.
4251 *
4252 * @typechecks
4253 * @providesModule ReactCSSTransitionGroupChild
4254 */
4255
4256'use strict';
4257
4258var React = _dereq_(26);
4259var ReactDOM = _dereq_(40);
4260
4261var CSSCore = _dereq_(145);
4262var ReactTransitionEvents = _dereq_(93);
4263
4264var onlyChild = _dereq_(135);
4265
4266// We don't remove the element from the DOM until we receive an animationend or
4267// transitionend event. If the user screws up and forgets to add an animation
4268// their node will be stuck in the DOM forever, so we detect if an animation
4269// does not start and if it doesn't, we just call the end listener immediately.
4270var TICK = 17;
4271
4272var ReactCSSTransitionGroupChild = React.createClass({
4273 displayName: 'ReactCSSTransitionGroupChild',
4274
4275 propTypes: {
4276 name: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.shape({
4277 enter: React.PropTypes.string,
4278 leave: React.PropTypes.string,
4279 active: React.PropTypes.string
4280 }), React.PropTypes.shape({
4281 enter: React.PropTypes.string,
4282 enterActive: React.PropTypes.string,
4283 leave: React.PropTypes.string,
4284 leaveActive: React.PropTypes.string,
4285 appear: React.PropTypes.string,
4286 appearActive: React.PropTypes.string
4287 })]).isRequired,
4288
4289 // Once we require timeouts to be specified, we can remove the
4290 // boolean flags (appear etc.) and just accept a number
4291 // or a bool for the timeout flags (appearTimeout etc.)
4292 appear: React.PropTypes.bool,
4293 enter: React.PropTypes.bool,
4294 leave: React.PropTypes.bool,
4295 appearTimeout: React.PropTypes.number,
4296 enterTimeout: React.PropTypes.number,
4297 leaveTimeout: React.PropTypes.number
4298 },
4299
4300 transition: function (animationType, finishCallback, userSpecifiedDelay) {
4301 var node = ReactDOM.findDOMNode(this);
4302
4303 if (!node) {
4304 if (finishCallback) {
4305 finishCallback();
4306 }
4307 return;
4308 }
4309
4310 var className = this.props.name[animationType] || this.props.name + '-' + animationType;
4311 var activeClassName = this.props.name[animationType + 'Active'] || className + '-active';
4312 var timeout = null;
4313
4314 var endListener = function (e) {
4315 if (e && e.target !== node) {
4316 return;
4317 }
4318
4319 clearTimeout(timeout);
4320
4321 CSSCore.removeClass(node, className);
4322 CSSCore.removeClass(node, activeClassName);
4323
4324 ReactTransitionEvents.removeEndEventListener(node, endListener);
4325
4326 // Usually this optional callback is used for informing an owner of
4327 // a leave animation and telling it to remove the child.
4328 if (finishCallback) {
4329 finishCallback();
4330 }
4331 };
4332
4333 CSSCore.addClass(node, className);
4334
4335 // Need to do this to actually trigger a transition.
4336 this.queueClass(activeClassName);
4337
4338 // If the user specified a timeout delay.
4339 if (userSpecifiedDelay) {
4340 // Clean-up the animation after the specified delay
4341 timeout = setTimeout(endListener, userSpecifiedDelay);
4342 this.transitionTimeouts.push(timeout);
4343 } else {
4344 // DEPRECATED: this listener will be removed in a future version of react
4345 ReactTransitionEvents.addEndEventListener(node, endListener);
4346 }
4347 },
4348
4349 queueClass: function (className) {
4350 this.classNameQueue.push(className);
4351
4352 if (!this.timeout) {
4353 this.timeout = setTimeout(this.flushClassNameQueue, TICK);
4354 }
4355 },
4356
4357 flushClassNameQueue: function () {
4358 if (this.isMounted()) {
4359 this.classNameQueue.forEach(CSSCore.addClass.bind(CSSCore, ReactDOM.findDOMNode(this)));
4360 }
4361 this.classNameQueue.length = 0;
4362 this.timeout = null;
4363 },
4364
4365 componentWillMount: function () {
4366 this.classNameQueue = [];
4367 this.transitionTimeouts = [];
4368 },
4369
4370 componentWillUnmount: function () {
4371 if (this.timeout) {
4372 clearTimeout(this.timeout);
4373 }
4374 this.transitionTimeouts.forEach(function (timeout) {
4375 clearTimeout(timeout);
4376 });
4377 },
4378
4379 componentWillAppear: function (done) {
4380 if (this.props.appear) {
4381 this.transition('appear', done, this.props.appearTimeout);
4382 } else {
4383 done();
4384 }
4385 },
4386
4387 componentWillEnter: function (done) {
4388 if (this.props.enter) {
4389 this.transition('enter', done, this.props.enterTimeout);
4390 } else {
4391 done();
4392 }
4393 },
4394
4395 componentWillLeave: function (done) {
4396 if (this.props.leave) {
4397 this.transition('leave', done, this.props.leaveTimeout);
4398 } else {
4399 done();
4400 }
4401 },
4402
4403 render: function () {
4404 return onlyChild(this.props.children);
4405 }
4406});
4407
4408module.exports = ReactCSSTransitionGroupChild;
4409},{"135":135,"145":145,"26":26,"40":40,"93":93}],31:[function(_dereq_,module,exports){
4410/**
4411 * Copyright 2014-2015, Facebook, Inc.
4412 * All rights reserved.
4413 *
4414 * This source code is licensed under the BSD-style license found in the
4415 * LICENSE file in the root directory of this source tree. An additional grant
4416 * of patent rights can be found in the PATENTS file in the same directory.
4417 *
4418 * @providesModule ReactChildReconciler
4419 * @typechecks static-only
4420 */
4421
4422'use strict';
4423
4424var ReactReconciler = _dereq_(84);
4425
4426var instantiateReactComponent = _dereq_(132);
4427var shouldUpdateReactComponent = _dereq_(141);
4428var traverseAllChildren = _dereq_(142);
4429var warning = _dereq_(173);
4430
4431function instantiateChild(childInstances, child, name) {
4432 // We found a component instance.
4433 var keyUnique = childInstances[name] === undefined;
4434 if ("development" !== 'production') {
4435 "development" !== 'production' ? warning(keyUnique, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.', name) : undefined;
4436 }
4437 if (child != null && keyUnique) {
4438 childInstances[name] = instantiateReactComponent(child, null);
4439 }
4440}
4441
4442/**
4443 * ReactChildReconciler provides helpers for initializing or updating a set of
4444 * children. Its output is suitable for passing it onto ReactMultiChild which
4445 * does diffed reordering and insertion.
4446 */
4447var ReactChildReconciler = {
4448 /**
4449 * Generates a "mount image" for each of the supplied children. In the case
4450 * of `ReactDOMComponent`, a mount image is a string of markup.
4451 *
4452 * @param {?object} nestedChildNodes Nested child maps.
4453 * @return {?object} A set of child instances.
4454 * @internal
4455 */
4456 instantiateChildren: function (nestedChildNodes, transaction, context) {
4457 if (nestedChildNodes == null) {
4458 return null;
4459 }
4460 var childInstances = {};
4461 traverseAllChildren(nestedChildNodes, instantiateChild, childInstances);
4462 return childInstances;
4463 },
4464
4465 /**
4466 * Updates the rendered children and returns a new set of children.
4467 *
4468 * @param {?object} prevChildren Previously initialized set of children.
4469 * @param {?object} nextChildren Flat child element maps.
4470 * @param {ReactReconcileTransaction} transaction
4471 * @param {object} context
4472 * @return {?object} A new set of child instances.
4473 * @internal
4474 */
4475 updateChildren: function (prevChildren, nextChildren, transaction, context) {
4476 // We currently don't have a way to track moves here but if we use iterators
4477 // instead of for..in we can zip the iterators and check if an item has
4478 // moved.
4479 // TODO: If nothing has changed, return the prevChildren object so that we
4480 // can quickly bailout if nothing has changed.
4481 if (!nextChildren && !prevChildren) {
4482 return null;
4483 }
4484 var name;
4485 for (name in nextChildren) {
4486 if (!nextChildren.hasOwnProperty(name)) {
4487 continue;
4488 }
4489 var prevChild = prevChildren && prevChildren[name];
4490 var prevElement = prevChild && prevChild._currentElement;
4491 var nextElement = nextChildren[name];
4492 if (prevChild != null && shouldUpdateReactComponent(prevElement, nextElement)) {
4493 ReactReconciler.receiveComponent(prevChild, nextElement, transaction, context);
4494 nextChildren[name] = prevChild;
4495 } else {
4496 if (prevChild) {
4497 ReactReconciler.unmountComponent(prevChild, name);
4498 }
4499 // The child must be instantiated before it's mounted.
4500 var nextChildInstance = instantiateReactComponent(nextElement, null);
4501 nextChildren[name] = nextChildInstance;
4502 }
4503 }
4504 // Unmount children that are no longer present.
4505 for (name in prevChildren) {
4506 if (prevChildren.hasOwnProperty(name) && !(nextChildren && nextChildren.hasOwnProperty(name))) {
4507 ReactReconciler.unmountComponent(prevChildren[name]);
4508 }
4509 }
4510 return nextChildren;
4511 },
4512
4513 /**
4514 * Unmounts all rendered children. This should be used to clean up children
4515 * when this component is unmounted.
4516 *
4517 * @param {?object} renderedChildren Previously initialized set of children.
4518 * @internal
4519 */
4520 unmountChildren: function (renderedChildren) {
4521 for (var name in renderedChildren) {
4522 if (renderedChildren.hasOwnProperty(name)) {
4523 var renderedChild = renderedChildren[name];
4524 ReactReconciler.unmountComponent(renderedChild);
4525 }
4526 }
4527 }
4528
4529};
4530
4531module.exports = ReactChildReconciler;
4532},{"132":132,"141":141,"142":142,"173":173,"84":84}],32:[function(_dereq_,module,exports){
4533/**
4534 * Copyright 2013-2015, Facebook, Inc.
4535 * All rights reserved.
4536 *
4537 * This source code is licensed under the BSD-style license found in the
4538 * LICENSE file in the root directory of this source tree. An additional grant
4539 * of patent rights can be found in the PATENTS file in the same directory.
4540 *
4541 * @providesModule ReactChildren
4542 */
4543
4544'use strict';
4545
4546var PooledClass = _dereq_(25);
4547var ReactElement = _dereq_(57);
4548
4549var emptyFunction = _dereq_(153);
4550var traverseAllChildren = _dereq_(142);
4551
4552var twoArgumentPooler = PooledClass.twoArgumentPooler;
4553var fourArgumentPooler = PooledClass.fourArgumentPooler;
4554
4555var userProvidedKeyEscapeRegex = /\/(?!\/)/g;
4556function escapeUserProvidedKey(text) {
4557 return ('' + text).replace(userProvidedKeyEscapeRegex, '//');
4558}
4559
4560/**
4561 * PooledClass representing the bookkeeping associated with performing a child
4562 * traversal. Allows avoiding binding callbacks.
4563 *
4564 * @constructor ForEachBookKeeping
4565 * @param {!function} forEachFunction Function to perform traversal with.
4566 * @param {?*} forEachContext Context to perform context with.
4567 */
4568function ForEachBookKeeping(forEachFunction, forEachContext) {
4569 this.func = forEachFunction;
4570 this.context = forEachContext;
4571 this.count = 0;
4572}
4573ForEachBookKeeping.prototype.destructor = function () {
4574 this.func = null;
4575 this.context = null;
4576 this.count = 0;
4577};
4578PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);
4579
4580function forEachSingleChild(bookKeeping, child, name) {
4581 var func = bookKeeping.func;
4582 var context = bookKeeping.context;
4583
4584 func.call(context, child, bookKeeping.count++);
4585}
4586
4587/**
4588 * Iterates through children that are typically specified as `props.children`.
4589 *
4590 * The provided forEachFunc(child, index) will be called for each
4591 * leaf child.
4592 *
4593 * @param {?*} children Children tree container.
4594 * @param {function(*, int)} forEachFunc
4595 * @param {*} forEachContext Context for forEachContext.
4596 */
4597function forEachChildren(children, forEachFunc, forEachContext) {
4598 if (children == null) {
4599 return children;
4600 }
4601 var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext);
4602 traverseAllChildren(children, forEachSingleChild, traverseContext);
4603 ForEachBookKeeping.release(traverseContext);
4604}
4605
4606/**
4607 * PooledClass representing the bookkeeping associated with performing a child
4608 * mapping. Allows avoiding binding callbacks.
4609 *
4610 * @constructor MapBookKeeping
4611 * @param {!*} mapResult Object containing the ordered map of results.
4612 * @param {!function} mapFunction Function to perform mapping with.
4613 * @param {?*} mapContext Context to perform mapping with.
4614 */
4615function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
4616 this.result = mapResult;
4617 this.keyPrefix = keyPrefix;
4618 this.func = mapFunction;
4619 this.context = mapContext;
4620 this.count = 0;
4621}
4622MapBookKeeping.prototype.destructor = function () {
4623 this.result = null;
4624 this.keyPrefix = null;
4625 this.func = null;
4626 this.context = null;
4627 this.count = 0;
4628};
4629PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler);
4630
4631function mapSingleChildIntoContext(bookKeeping, child, childKey) {
4632 var result = bookKeeping.result;
4633 var keyPrefix = bookKeeping.keyPrefix;
4634 var func = bookKeeping.func;
4635 var context = bookKeeping.context;
4636
4637 var mappedChild = func.call(context, child, bookKeeping.count++);
4638 if (Array.isArray(mappedChild)) {
4639 mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument);
4640 } else if (mappedChild != null) {
4641 if (ReactElement.isValidElement(mappedChild)) {
4642 mappedChild = ReactElement.cloneAndReplaceKey(mappedChild,
4643 // Keep both the (mapped) and old keys if they differ, just as
4644 // traverseAllChildren used to do for objects as children
4645 keyPrefix + (mappedChild !== child ? escapeUserProvidedKey(mappedChild.key || '') + '/' : '') + childKey);
4646 }
4647 result.push(mappedChild);
4648 }
4649}
4650
4651function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
4652 var escapedPrefix = '';
4653 if (prefix != null) {
4654 escapedPrefix = escapeUserProvidedKey(prefix) + '/';
4655 }
4656 var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context);
4657 traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
4658 MapBookKeeping.release(traverseContext);
4659}
4660
4661/**
4662 * Maps children that are typically specified as `props.children`.
4663 *
4664 * The provided mapFunction(child, key, index) will be called for each
4665 * leaf child.
4666 *
4667 * @param {?*} children Children tree container.
4668 * @param {function(*, int)} func The map function.
4669 * @param {*} context Context for mapFunction.
4670 * @return {object} Object containing the ordered map of results.
4671 */
4672function mapChildren(children, func, context) {
4673 if (children == null) {
4674 return children;
4675 }
4676 var result = [];
4677 mapIntoWithKeyPrefixInternal(children, result, null, func, context);
4678 return result;
4679}
4680
4681function forEachSingleChildDummy(traverseContext, child, name) {
4682 return null;
4683}
4684
4685/**
4686 * Count the number of children that are typically specified as
4687 * `props.children`.
4688 *
4689 * @param {?*} children Children tree container.
4690 * @return {number} The number of children.
4691 */
4692function countChildren(children, context) {
4693 return traverseAllChildren(children, forEachSingleChildDummy, null);
4694}
4695
4696/**
4697 * Flatten a children object (typically specified as `props.children`) and
4698 * return an array with appropriately re-keyed children.
4699 */
4700function toArray(children) {
4701 var result = [];
4702 mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);
4703 return result;
4704}
4705
4706var ReactChildren = {
4707 forEach: forEachChildren,
4708 map: mapChildren,
4709 mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal,
4710 count: countChildren,
4711 toArray: toArray
4712};
4713
4714module.exports = ReactChildren;
4715},{"142":142,"153":153,"25":25,"57":57}],33:[function(_dereq_,module,exports){
4716/**
4717 * Copyright 2013-2015, Facebook, Inc.
4718 * All rights reserved.
4719 *
4720 * This source code is licensed under the BSD-style license found in the
4721 * LICENSE file in the root directory of this source tree. An additional grant
4722 * of patent rights can be found in the PATENTS file in the same directory.
4723 *
4724 * @providesModule ReactClass
4725 */
4726
4727'use strict';
4728
4729var ReactComponent = _dereq_(34);
4730var ReactElement = _dereq_(57);
4731var ReactPropTypeLocations = _dereq_(81);
4732var ReactPropTypeLocationNames = _dereq_(80);
4733var ReactNoopUpdateQueue = _dereq_(76);
4734
4735var assign = _dereq_(24);
4736var emptyObject = _dereq_(154);
4737var invariant = _dereq_(161);
4738var keyMirror = _dereq_(165);
4739var keyOf = _dereq_(166);
4740var warning = _dereq_(173);
4741
4742var MIXINS_KEY = keyOf({ mixins: null });
4743
4744/**
4745 * Policies that describe methods in `ReactClassInterface`.
4746 */
4747var SpecPolicy = keyMirror({
4748 /**
4749 * These methods may be defined only once by the class specification or mixin.
4750 */
4751 DEFINE_ONCE: null,
4752 /**
4753 * These methods may be defined by both the class specification and mixins.
4754 * Subsequent definitions will be chained. These methods must return void.
4755 */
4756 DEFINE_MANY: null,
4757 /**
4758 * These methods are overriding the base class.
4759 */
4760 OVERRIDE_BASE: null,
4761 /**
4762 * These methods are similar to DEFINE_MANY, except we assume they return
4763 * objects. We try to merge the keys of the return values of all the mixed in
4764 * functions. If there is a key conflict we throw.
4765 */
4766 DEFINE_MANY_MERGED: null
4767});
4768
4769var injectedMixins = [];
4770
4771var warnedSetProps = false;
4772function warnSetProps() {
4773 if (!warnedSetProps) {
4774 warnedSetProps = true;
4775 "development" !== 'production' ? warning(false, 'setProps(...) and replaceProps(...) are deprecated. ' + 'Instead, call render again at the top level.') : undefined;
4776 }
4777}
4778
4779/**
4780 * Composite components are higher-level components that compose other composite
4781 * or native components.
4782 *
4783 * To create a new type of `ReactClass`, pass a specification of
4784 * your new class to `React.createClass`. The only requirement of your class
4785 * specification is that you implement a `render` method.
4786 *
4787 * var MyComponent = React.createClass({
4788 * render: function() {
4789 * return <div>Hello World</div>;
4790 * }
4791 * });
4792 *
4793 * The class specification supports a specific protocol of methods that have
4794 * special meaning (e.g. `render`). See `ReactClassInterface` for
4795 * more the comprehensive protocol. Any other properties and methods in the
4796 * class specification will be available on the prototype.
4797 *
4798 * @interface ReactClassInterface
4799 * @internal
4800 */
4801var ReactClassInterface = {
4802
4803 /**
4804 * An array of Mixin objects to include when defining your component.
4805 *
4806 * @type {array}
4807 * @optional
4808 */
4809 mixins: SpecPolicy.DEFINE_MANY,
4810
4811 /**
4812 * An object containing properties and methods that should be defined on
4813 * the component's constructor instead of its prototype (static methods).
4814 *
4815 * @type {object}
4816 * @optional
4817 */
4818 statics: SpecPolicy.DEFINE_MANY,
4819
4820 /**
4821 * Definition of prop types for this component.
4822 *
4823 * @type {object}
4824 * @optional
4825 */
4826 propTypes: SpecPolicy.DEFINE_MANY,
4827
4828 /**
4829 * Definition of context types for this component.
4830 *
4831 * @type {object}
4832 * @optional
4833 */
4834 contextTypes: SpecPolicy.DEFINE_MANY,
4835
4836 /**
4837 * Definition of context types this component sets for its children.
4838 *
4839 * @type {object}
4840 * @optional
4841 */
4842 childContextTypes: SpecPolicy.DEFINE_MANY,
4843
4844 // ==== Definition methods ====
4845
4846 /**
4847 * Invoked when the component is mounted. Values in the mapping will be set on
4848 * `this.props` if that prop is not specified (i.e. using an `in` check).
4849 *
4850 * This method is invoked before `getInitialState` and therefore cannot rely
4851 * on `this.state` or use `this.setState`.
4852 *
4853 * @return {object}
4854 * @optional
4855 */
4856 getDefaultProps: SpecPolicy.DEFINE_MANY_MERGED,
4857
4858 /**
4859 * Invoked once before the component is mounted. The return value will be used
4860 * as the initial value of `this.state`.
4861 *
4862 * getInitialState: function() {
4863 * return {
4864 * isOn: false,
4865 * fooBaz: new BazFoo()
4866 * }
4867 * }
4868 *
4869 * @return {object}
4870 * @optional
4871 */
4872 getInitialState: SpecPolicy.DEFINE_MANY_MERGED,
4873
4874 /**
4875 * @return {object}
4876 * @optional
4877 */
4878 getChildContext: SpecPolicy.DEFINE_MANY_MERGED,
4879
4880 /**
4881 * Uses props from `this.props` and state from `this.state` to render the
4882 * structure of the component.
4883 *
4884 * No guarantees are made about when or how often this method is invoked, so
4885 * it must not have side effects.
4886 *
4887 * render: function() {
4888 * var name = this.props.name;
4889 * return <div>Hello, {name}!</div>;
4890 * }
4891 *
4892 * @return {ReactComponent}
4893 * @nosideeffects
4894 * @required
4895 */
4896 render: SpecPolicy.DEFINE_ONCE,
4897
4898 // ==== Delegate methods ====
4899
4900 /**
4901 * Invoked when the component is initially created and about to be mounted.
4902 * This may have side effects, but any external subscriptions or data created
4903 * by this method must be cleaned up in `componentWillUnmount`.
4904 *
4905 * @optional
4906 */
4907 componentWillMount: SpecPolicy.DEFINE_MANY,
4908
4909 /**
4910 * Invoked when the component has been mounted and has a DOM representation.
4911 * However, there is no guarantee that the DOM node is in the document.
4912 *
4913 * Use this as an opportunity to operate on the DOM when the component has
4914 * been mounted (initialized and rendered) for the first time.
4915 *
4916 * @param {DOMElement} rootNode DOM element representing the component.
4917 * @optional
4918 */
4919 componentDidMount: SpecPolicy.DEFINE_MANY,
4920
4921 /**
4922 * Invoked before the component receives new props.
4923 *
4924 * Use this as an opportunity to react to a prop transition by updating the
4925 * state using `this.setState`. Current props are accessed via `this.props`.
4926 *
4927 * componentWillReceiveProps: function(nextProps, nextContext) {
4928 * this.setState({
4929 * likesIncreasing: nextProps.likeCount > this.props.likeCount
4930 * });
4931 * }
4932 *
4933 * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop
4934 * transition may cause a state change, but the opposite is not true. If you
4935 * need it, you are probably looking for `componentWillUpdate`.
4936 *
4937 * @param {object} nextProps
4938 * @optional
4939 */
4940 componentWillReceiveProps: SpecPolicy.DEFINE_MANY,
4941
4942 /**
4943 * Invoked while deciding if the component should be updated as a result of
4944 * receiving new props, state and/or context.
4945 *
4946 * Use this as an opportunity to `return false` when you're certain that the
4947 * transition to the new props/state/context will not require a component
4948 * update.
4949 *
4950 * shouldComponentUpdate: function(nextProps, nextState, nextContext) {
4951 * return !equal(nextProps, this.props) ||
4952 * !equal(nextState, this.state) ||
4953 * !equal(nextContext, this.context);
4954 * }
4955 *
4956 * @param {object} nextProps
4957 * @param {?object} nextState
4958 * @param {?object} nextContext
4959 * @return {boolean} True if the component should update.
4960 * @optional
4961 */
4962 shouldComponentUpdate: SpecPolicy.DEFINE_ONCE,
4963
4964 /**
4965 * Invoked when the component is about to update due to a transition from
4966 * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
4967 * and `nextContext`.
4968 *
4969 * Use this as an opportunity to perform preparation before an update occurs.
4970 *
4971 * NOTE: You **cannot** use `this.setState()` in this method.
4972 *
4973 * @param {object} nextProps
4974 * @param {?object} nextState
4975 * @param {?object} nextContext
4976 * @param {ReactReconcileTransaction} transaction
4977 * @optional
4978 */
4979 componentWillUpdate: SpecPolicy.DEFINE_MANY,
4980
4981 /**
4982 * Invoked when the component's DOM representation has been updated.
4983 *
4984 * Use this as an opportunity to operate on the DOM when the component has
4985 * been updated.
4986 *
4987 * @param {object} prevProps
4988 * @param {?object} prevState
4989 * @param {?object} prevContext
4990 * @param {DOMElement} rootNode DOM element representing the component.
4991 * @optional
4992 */
4993 componentDidUpdate: SpecPolicy.DEFINE_MANY,
4994
4995 /**
4996 * Invoked when the component is about to be removed from its parent and have
4997 * its DOM representation destroyed.
4998 *
4999 * Use this as an opportunity to deallocate any external resources.
5000 *
5001 * NOTE: There is no `componentDidUnmount` since your component will have been
5002 * destroyed by that point.
5003 *
5004 * @optional
5005 */
5006 componentWillUnmount: SpecPolicy.DEFINE_MANY,
5007
5008 // ==== Advanced methods ====
5009
5010 /**
5011 * Updates the component's currently mounted DOM representation.
5012 *
5013 * By default, this implements React's rendering and reconciliation algorithm.
5014 * Sophisticated clients may wish to override this.
5015 *
5016 * @param {ReactReconcileTransaction} transaction
5017 * @internal
5018 * @overridable
5019 */
5020 updateComponent: SpecPolicy.OVERRIDE_BASE
5021
5022};
5023
5024/**
5025 * Mapping from class specification keys to special processing functions.
5026 *
5027 * Although these are declared like instance properties in the specification
5028 * when defining classes using `React.createClass`, they are actually static
5029 * and are accessible on the constructor instead of the prototype. Despite
5030 * being static, they must be defined outside of the "statics" key under
5031 * which all other static methods are defined.
5032 */
5033var RESERVED_SPEC_KEYS = {
5034 displayName: function (Constructor, displayName) {
5035 Constructor.displayName = displayName;
5036 },
5037 mixins: function (Constructor, mixins) {
5038 if (mixins) {
5039 for (var i = 0; i < mixins.length; i++) {
5040 mixSpecIntoComponent(Constructor, mixins[i]);
5041 }
5042 }
5043 },
5044 childContextTypes: function (Constructor, childContextTypes) {
5045 if ("development" !== 'production') {
5046 validateTypeDef(Constructor, childContextTypes, ReactPropTypeLocations.childContext);
5047 }
5048 Constructor.childContextTypes = assign({}, Constructor.childContextTypes, childContextTypes);
5049 },
5050 contextTypes: function (Constructor, contextTypes) {
5051 if ("development" !== 'production') {
5052 validateTypeDef(Constructor, contextTypes, ReactPropTypeLocations.context);
5053 }
5054 Constructor.contextTypes = assign({}, Constructor.contextTypes, contextTypes);
5055 },
5056 /**
5057 * Special case getDefaultProps which should move into statics but requires
5058 * automatic merging.
5059 */
5060 getDefaultProps: function (Constructor, getDefaultProps) {
5061 if (Constructor.getDefaultProps) {
5062 Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps);
5063 } else {
5064 Constructor.getDefaultProps = getDefaultProps;
5065 }
5066 },
5067 propTypes: function (Constructor, propTypes) {
5068 if ("development" !== 'production') {
5069 validateTypeDef(Constructor, propTypes, ReactPropTypeLocations.prop);
5070 }
5071 Constructor.propTypes = assign({}, Constructor.propTypes, propTypes);
5072 },
5073 statics: function (Constructor, statics) {
5074 mixStaticSpecIntoComponent(Constructor, statics);
5075 },
5076 autobind: function () {} };
5077
5078// noop
5079function validateTypeDef(Constructor, typeDef, location) {
5080 for (var propName in typeDef) {
5081 if (typeDef.hasOwnProperty(propName)) {
5082 // use a warning instead of an invariant so components
5083 // don't show up in prod but not in __DEV__
5084 "development" !== 'production' ? warning(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', ReactPropTypeLocationNames[location], propName) : undefined;
5085 }
5086 }
5087}
5088
5089function validateMethodOverride(proto, name) {
5090 var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null;
5091
5092 // Disallow overriding of base class methods unless explicitly allowed.
5093 if (ReactClassMixin.hasOwnProperty(name)) {
5094 !(specPolicy === SpecPolicy.OVERRIDE_BASE) ? "development" !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to override ' + '`%s` from your class specification. Ensure that your method names ' + 'do not overlap with React methods.', name) : invariant(false) : undefined;
5095 }
5096
5097 // Disallow defining methods more than once unless explicitly allowed.
5098 if (proto.hasOwnProperty(name)) {
5099 !(specPolicy === SpecPolicy.DEFINE_MANY || specPolicy === SpecPolicy.DEFINE_MANY_MERGED) ? "development" !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to define ' + '`%s` on your component more than once. This conflict may be due ' + 'to a mixin.', name) : invariant(false) : undefined;
5100 }
5101}
5102
5103/**
5104 * Mixin helper which handles policy validation and reserved
5105 * specification keys when building React classses.
5106 */
5107function mixSpecIntoComponent(Constructor, spec) {
5108 if (!spec) {
5109 return;
5110 }
5111
5112 !(typeof spec !== 'function') ? "development" !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to ' + 'use a component class as a mixin. Instead, just use a regular object.') : invariant(false) : undefined;
5113 !!ReactElement.isValidElement(spec) ? "development" !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to ' + 'use a component as a mixin. Instead, just use a regular object.') : invariant(false) : undefined;
5114
5115 var proto = Constructor.prototype;
5116
5117 // By handling mixins before any other properties, we ensure the same
5118 // chaining order is applied to methods with DEFINE_MANY policy, whether
5119 // mixins are listed before or after these methods in the spec.
5120 if (spec.hasOwnProperty(MIXINS_KEY)) {
5121 RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
5122 }
5123
5124 for (var name in spec) {
5125 if (!spec.hasOwnProperty(name)) {
5126 continue;
5127 }
5128
5129 if (name === MIXINS_KEY) {
5130 // We have already handled mixins in a special case above.
5131 continue;
5132 }
5133
5134 var property = spec[name];
5135 validateMethodOverride(proto, name);
5136
5137 if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
5138 RESERVED_SPEC_KEYS[name](Constructor, property);
5139 } else {
5140 // Setup methods on prototype:
5141 // The following member methods should not be automatically bound:
5142 // 1. Expected ReactClass methods (in the "interface").
5143 // 2. Overridden methods (that were mixed in).
5144 var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
5145 var isAlreadyDefined = proto.hasOwnProperty(name);
5146 var isFunction = typeof property === 'function';
5147 var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false;
5148
5149 if (shouldAutoBind) {
5150 if (!proto.__reactAutoBindMap) {
5151 proto.__reactAutoBindMap = {};
5152 }
5153 proto.__reactAutoBindMap[name] = property;
5154 proto[name] = property;
5155 } else {
5156 if (isAlreadyDefined) {
5157 var specPolicy = ReactClassInterface[name];
5158
5159 // These cases should already be caught by validateMethodOverride.
5160 !(isReactClassMethod && (specPolicy === SpecPolicy.DEFINE_MANY_MERGED || specPolicy === SpecPolicy.DEFINE_MANY)) ? "development" !== 'production' ? invariant(false, 'ReactClass: Unexpected spec policy %s for key %s ' + 'when mixing in component specs.', specPolicy, name) : invariant(false) : undefined;
5161
5162 // For methods which are defined more than once, call the existing
5163 // methods before calling the new property, merging if appropriate.
5164 if (specPolicy === SpecPolicy.DEFINE_MANY_MERGED) {
5165 proto[name] = createMergedResultFunction(proto[name], property);
5166 } else if (specPolicy === SpecPolicy.DEFINE_MANY) {
5167 proto[name] = createChainedFunction(proto[name], property);
5168 }
5169 } else {
5170 proto[name] = property;
5171 if ("development" !== 'production') {
5172 // Add verbose displayName to the function, which helps when looking
5173 // at profiling tools.
5174 if (typeof property === 'function' && spec.displayName) {
5175 proto[name].displayName = spec.displayName + '_' + name;
5176 }
5177 }
5178 }
5179 }
5180 }
5181 }
5182}
5183
5184function mixStaticSpecIntoComponent(Constructor, statics) {
5185 if (!statics) {
5186 return;
5187 }
5188 for (var name in statics) {
5189 var property = statics[name];
5190 if (!statics.hasOwnProperty(name)) {
5191 continue;
5192 }
5193
5194 var isReserved = (name in RESERVED_SPEC_KEYS);
5195 !!isReserved ? "development" !== 'production' ? invariant(false, 'ReactClass: You are attempting to define a reserved ' + 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + 'as an instance property instead; it will still be accessible on the ' + 'constructor.', name) : invariant(false) : undefined;
5196
5197 var isInherited = (name in Constructor);
5198 !!isInherited ? "development" !== 'production' ? invariant(false, 'ReactClass: You are attempting to define ' + '`%s` on your component more than once. This conflict may be ' + 'due to a mixin.', name) : invariant(false) : undefined;
5199 Constructor[name] = property;
5200 }
5201}
5202
5203/**
5204 * Merge two objects, but throw if both contain the same key.
5205 *
5206 * @param {object} one The first object, which is mutated.
5207 * @param {object} two The second object
5208 * @return {object} one after it has been mutated to contain everything in two.
5209 */
5210function mergeIntoWithNoDuplicateKeys(one, two) {
5211 !(one && two && typeof one === 'object' && typeof two === 'object') ? "development" !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.') : invariant(false) : undefined;
5212
5213 for (var key in two) {
5214 if (two.hasOwnProperty(key)) {
5215 !(one[key] === undefined) ? "development" !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): ' + 'Tried to merge two objects with the same key: `%s`. This conflict ' + 'may be due to a mixin; in particular, this may be caused by two ' + 'getInitialState() or getDefaultProps() methods returning objects ' + 'with clashing keys.', key) : invariant(false) : undefined;
5216 one[key] = two[key];
5217 }
5218 }
5219 return one;
5220}
5221
5222/**
5223 * Creates a function that invokes two functions and merges their return values.
5224 *
5225 * @param {function} one Function to invoke first.
5226 * @param {function} two Function to invoke second.
5227 * @return {function} Function that invokes the two argument functions.
5228 * @private
5229 */
5230function createMergedResultFunction(one, two) {
5231 return function mergedResult() {
5232 var a = one.apply(this, arguments);
5233 var b = two.apply(this, arguments);
5234 if (a == null) {
5235 return b;
5236 } else if (b == null) {
5237 return a;
5238 }
5239 var c = {};
5240 mergeIntoWithNoDuplicateKeys(c, a);
5241 mergeIntoWithNoDuplicateKeys(c, b);
5242 return c;
5243 };
5244}
5245
5246/**
5247 * Creates a function that invokes two functions and ignores their return vales.
5248 *
5249 * @param {function} one Function to invoke first.
5250 * @param {function} two Function to invoke second.
5251 * @return {function} Function that invokes the two argument functions.
5252 * @private
5253 */
5254function createChainedFunction(one, two) {
5255 return function chainedFunction() {
5256 one.apply(this, arguments);
5257 two.apply(this, arguments);
5258 };
5259}
5260
5261/**
5262 * Binds a method to the component.
5263 *
5264 * @param {object} component Component whose method is going to be bound.
5265 * @param {function} method Method to be bound.
5266 * @return {function} The bound method.
5267 */
5268function bindAutoBindMethod(component, method) {
5269 var boundMethod = method.bind(component);
5270 if ("development" !== 'production') {
5271 boundMethod.__reactBoundContext = component;
5272 boundMethod.__reactBoundMethod = method;
5273 boundMethod.__reactBoundArguments = null;
5274 var componentName = component.constructor.displayName;
5275 var _bind = boundMethod.bind;
5276 /* eslint-disable block-scoped-var, no-undef */
5277 boundMethod.bind = function (newThis) {
5278 for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
5279 args[_key - 1] = arguments[_key];
5280 }
5281
5282 // User is trying to bind() an autobound method; we effectively will
5283 // ignore the value of "this" that the user is trying to use, so
5284 // let's warn.
5285 if (newThis !== component && newThis !== null) {
5286 "development" !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName) : undefined;
5287 } else if (!args.length) {
5288 "development" !== 'production' ? warning(false, 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call. See %s', componentName) : undefined;
5289 return boundMethod;
5290 }
5291 var reboundMethod = _bind.apply(boundMethod, arguments);
5292 reboundMethod.__reactBoundContext = component;
5293 reboundMethod.__reactBoundMethod = method;
5294 reboundMethod.__reactBoundArguments = args;
5295 return reboundMethod;
5296 /* eslint-enable */
5297 };
5298 }
5299 return boundMethod;
5300}
5301
5302/**
5303 * Binds all auto-bound methods in a component.
5304 *
5305 * @param {object} component Component whose method is going to be bound.
5306 */
5307function bindAutoBindMethods(component) {
5308 for (var autoBindKey in component.__reactAutoBindMap) {
5309 if (component.__reactAutoBindMap.hasOwnProperty(autoBindKey)) {
5310 var method = component.__reactAutoBindMap[autoBindKey];
5311 component[autoBindKey] = bindAutoBindMethod(component, method);
5312 }
5313 }
5314}
5315
5316/**
5317 * Add more to the ReactClass base class. These are all legacy features and
5318 * therefore not already part of the modern ReactComponent.
5319 */
5320var ReactClassMixin = {
5321
5322 /**
5323 * TODO: This will be deprecated because state should always keep a consistent
5324 * type signature and the only use case for this, is to avoid that.
5325 */
5326 replaceState: function (newState, callback) {
5327 this.updater.enqueueReplaceState(this, newState);
5328 if (callback) {
5329 this.updater.enqueueCallback(this, callback);
5330 }
5331 },
5332
5333 /**
5334 * Checks whether or not this composite component is mounted.
5335 * @return {boolean} True if mounted, false otherwise.
5336 * @protected
5337 * @final
5338 */
5339 isMounted: function () {
5340 return this.updater.isMounted(this);
5341 },
5342
5343 /**
5344 * Sets a subset of the props.
5345 *
5346 * @param {object} partialProps Subset of the next props.
5347 * @param {?function} callback Called after props are updated.
5348 * @final
5349 * @public
5350 * @deprecated
5351 */
5352 setProps: function (partialProps, callback) {
5353 if ("development" !== 'production') {
5354 warnSetProps();
5355 }
5356 this.updater.enqueueSetProps(this, partialProps);
5357 if (callback) {
5358 this.updater.enqueueCallback(this, callback);
5359 }
5360 },
5361
5362 /**
5363 * Replace all the props.
5364 *
5365 * @param {object} newProps Subset of the next props.
5366 * @param {?function} callback Called after props are updated.
5367 * @final
5368 * @public
5369 * @deprecated
5370 */
5371 replaceProps: function (newProps, callback) {
5372 if ("development" !== 'production') {
5373 warnSetProps();
5374 }
5375 this.updater.enqueueReplaceProps(this, newProps);
5376 if (callback) {
5377 this.updater.enqueueCallback(this, callback);
5378 }
5379 }
5380};
5381
5382var ReactClassComponent = function () {};
5383assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin);
5384
5385/**
5386 * Module for creating composite components.
5387 *
5388 * @class ReactClass
5389 */
5390var ReactClass = {
5391
5392 /**
5393 * Creates a composite component class given a class specification.
5394 *
5395 * @param {object} spec Class specification (which must define `render`).
5396 * @return {function} Component constructor function.
5397 * @public
5398 */
5399 createClass: function (spec) {
5400 var Constructor = function (props, context, updater) {
5401 // This constructor is overridden by mocks. The argument is used
5402 // by mocks to assert on what gets mounted.
5403
5404 if ("development" !== 'production') {
5405 "development" !== 'production' ? warning(this instanceof Constructor, 'Something is calling a React component directly. Use a factory or ' + 'JSX instead. See: https://fb.me/react-legacyfactory') : undefined;
5406 }
5407
5408 // Wire up auto-binding
5409 if (this.__reactAutoBindMap) {
5410 bindAutoBindMethods(this);
5411 }
5412
5413 this.props = props;
5414 this.context = context;
5415 this.refs = emptyObject;
5416 this.updater = updater || ReactNoopUpdateQueue;
5417
5418 this.state = null;
5419
5420 // ReactClasses doesn't have constructors. Instead, they use the
5421 // getInitialState and componentWillMount methods for initialization.
5422
5423 var initialState = this.getInitialState ? this.getInitialState() : null;
5424 if ("development" !== 'production') {
5425 // We allow auto-mocks to proceed as if they're returning null.
5426 if (typeof initialState === 'undefined' && this.getInitialState._isMockFunction) {
5427 // This is probably bad practice. Consider warning here and
5428 // deprecating this convenience.
5429 initialState = null;
5430 }
5431 }
5432 !(typeof initialState === 'object' && !Array.isArray(initialState)) ? "development" !== 'production' ? invariant(false, '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent') : invariant(false) : undefined;
5433
5434 this.state = initialState;
5435 };
5436 Constructor.prototype = new ReactClassComponent();
5437 Constructor.prototype.constructor = Constructor;
5438
5439 injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));
5440
5441 mixSpecIntoComponent(Constructor, spec);
5442
5443 // Initialize the defaultProps property after all mixins have been merged.
5444 if (Constructor.getDefaultProps) {
5445 Constructor.defaultProps = Constructor.getDefaultProps();
5446 }
5447
5448 if ("development" !== 'production') {
5449 // This is a tag to indicate that the use of these method names is ok,
5450 // since it's used with createClass. If it's not, then it's likely a
5451 // mistake so we'll warn you to use the static property, property
5452 // initializer or constructor respectively.
5453 if (Constructor.getDefaultProps) {
5454 Constructor.getDefaultProps.isReactClassApproved = {};
5455 }
5456 if (Constructor.prototype.getInitialState) {
5457 Constructor.prototype.getInitialState.isReactClassApproved = {};
5458 }
5459 }
5460
5461 !Constructor.prototype.render ? "development" !== 'production' ? invariant(false, 'createClass(...): Class specification must implement a `render` method.') : invariant(false) : undefined;
5462
5463 if ("development" !== 'production') {
5464 "development" !== 'production' ? warning(!Constructor.prototype.componentShouldUpdate, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', spec.displayName || 'A component') : undefined;
5465 "development" !== 'production' ? warning(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component') : undefined;
5466 }
5467
5468 // Reduce time spent doing lookups by setting these on the prototype.
5469 for (var methodName in ReactClassInterface) {
5470 if (!Constructor.prototype[methodName]) {
5471 Constructor.prototype[methodName] = null;
5472 }
5473 }
5474
5475 return Constructor;
5476 },
5477
5478 injection: {
5479 injectMixin: function (mixin) {
5480 injectedMixins.push(mixin);
5481 }
5482 }
5483
5484};
5485
5486module.exports = ReactClass;
5487},{"154":154,"161":161,"165":165,"166":166,"173":173,"24":24,"34":34,"57":57,"76":76,"80":80,"81":81}],34:[function(_dereq_,module,exports){
5488/**
5489 * Copyright 2013-2015, Facebook, Inc.
5490 * All rights reserved.
5491 *
5492 * This source code is licensed under the BSD-style license found in the
5493 * LICENSE file in the root directory of this source tree. An additional grant
5494 * of patent rights can be found in the PATENTS file in the same directory.
5495 *
5496 * @providesModule ReactComponent
5497 */
5498
5499'use strict';
5500
5501var ReactNoopUpdateQueue = _dereq_(76);
5502
5503var canDefineProperty = _dereq_(117);
5504var emptyObject = _dereq_(154);
5505var invariant = _dereq_(161);
5506var warning = _dereq_(173);
5507
5508/**
5509 * Base class helpers for the updating state of a component.
5510 */
5511function ReactComponent(props, context, updater) {
5512 this.props = props;
5513 this.context = context;
5514 this.refs = emptyObject;
5515 // We initialize the default updater but the real one gets injected by the
5516 // renderer.
5517 this.updater = updater || ReactNoopUpdateQueue;
5518}
5519
5520ReactComponent.prototype.isReactComponent = {};
5521
5522/**
5523 * Sets a subset of the state. Always use this to mutate
5524 * state. You should treat `this.state` as immutable.
5525 *
5526 * There is no guarantee that `this.state` will be immediately updated, so
5527 * accessing `this.state` after calling this method may return the old value.
5528 *
5529 * There is no guarantee that calls to `setState` will run synchronously,
5530 * as they may eventually be batched together. You can provide an optional
5531 * callback that will be executed when the call to setState is actually
5532 * completed.
5533 *
5534 * When a function is provided to setState, it will be called at some point in
5535 * the future (not synchronously). It will be called with the up to date
5536 * component arguments (state, props, context). These values can be different
5537 * from this.* because your function may be called after receiveProps but before
5538 * shouldComponentUpdate, and this new state, props, and context will not yet be
5539 * assigned to this.
5540 *
5541 * @param {object|function} partialState Next partial state or function to
5542 * produce next partial state to be merged with current state.
5543 * @param {?function} callback Called after state is updated.
5544 * @final
5545 * @protected
5546 */
5547ReactComponent.prototype.setState = function (partialState, callback) {
5548 !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? "development" !== 'production' ? invariant(false, 'setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.') : invariant(false) : undefined;
5549 if ("development" !== 'production') {
5550 "development" !== 'production' ? warning(partialState != null, 'setState(...): You passed an undefined or null state object; ' + 'instead, use forceUpdate().') : undefined;
5551 }
5552 this.updater.enqueueSetState(this, partialState);
5553 if (callback) {
5554 this.updater.enqueueCallback(this, callback);
5555 }
5556};
5557
5558/**
5559 * Forces an update. This should only be invoked when it is known with
5560 * certainty that we are **not** in a DOM transaction.
5561 *
5562 * You may want to call this when you know that some deeper aspect of the
5563 * component's state has changed but `setState` was not called.
5564 *
5565 * This will not invoke `shouldComponentUpdate`, but it will invoke
5566 * `componentWillUpdate` and `componentDidUpdate`.
5567 *
5568 * @param {?function} callback Called after update is complete.
5569 * @final
5570 * @protected
5571 */
5572ReactComponent.prototype.forceUpdate = function (callback) {
5573 this.updater.enqueueForceUpdate(this);
5574 if (callback) {
5575 this.updater.enqueueCallback(this, callback);
5576 }
5577};
5578
5579/**
5580 * Deprecated APIs. These APIs used to exist on classic React classes but since
5581 * we would like to deprecate them, we're not going to move them over to this
5582 * modern base class. Instead, we define a getter that warns if it's accessed.
5583 */
5584if ("development" !== 'production') {
5585 var deprecatedAPIs = {
5586 getDOMNode: ['getDOMNode', 'Use ReactDOM.findDOMNode(component) instead.'],
5587 isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
5588 replaceProps: ['replaceProps', 'Instead, call render again at the top level.'],
5589 replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).'],
5590 setProps: ['setProps', 'Instead, call render again at the top level.']
5591 };
5592 var defineDeprecationWarning = function (methodName, info) {
5593 if (canDefineProperty) {
5594 Object.defineProperty(ReactComponent.prototype, methodName, {
5595 get: function () {
5596 "development" !== 'production' ? warning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]) : undefined;
5597 return undefined;
5598 }
5599 });
5600 }
5601 };
5602 for (var fnName in deprecatedAPIs) {
5603 if (deprecatedAPIs.hasOwnProperty(fnName)) {
5604 defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
5605 }
5606 }
5607}
5608
5609module.exports = ReactComponent;
5610},{"117":117,"154":154,"161":161,"173":173,"76":76}],35:[function(_dereq_,module,exports){
5611/**
5612 * Copyright 2013-2015, Facebook, Inc.
5613 * All rights reserved.
5614 *
5615 * This source code is licensed under the BSD-style license found in the
5616 * LICENSE file in the root directory of this source tree. An additional grant
5617 * of patent rights can be found in the PATENTS file in the same directory.
5618 *
5619 * @providesModule ReactComponentBrowserEnvironment
5620 */
5621
5622'use strict';
5623
5624var ReactDOMIDOperations = _dereq_(45);
5625var ReactMount = _dereq_(72);
5626
5627/**
5628 * Abstracts away all functionality of the reconciler that requires knowledge of
5629 * the browser context. TODO: These callers should be refactored to avoid the
5630 * need for this injection.
5631 */
5632var ReactComponentBrowserEnvironment = {
5633
5634 processChildrenUpdates: ReactDOMIDOperations.dangerouslyProcessChildrenUpdates,
5635
5636 replaceNodeWithMarkupByID: ReactDOMIDOperations.dangerouslyReplaceNodeWithMarkupByID,
5637
5638 /**
5639 * If a particular environment requires that some resources be cleaned up,
5640 * specify this in the injected Mixin. In the DOM, we would likely want to
5641 * purge any cached node ID lookups.
5642 *
5643 * @private
5644 */
5645 unmountIDFromEnvironment: function (rootNodeID) {
5646 ReactMount.purgeID(rootNodeID);
5647 }
5648
5649};
5650
5651module.exports = ReactComponentBrowserEnvironment;
5652},{"45":45,"72":72}],36:[function(_dereq_,module,exports){
5653/**
5654 * Copyright 2014-2015, Facebook, Inc.
5655 * All rights reserved.
5656 *
5657 * This source code is licensed under the BSD-style license found in the
5658 * LICENSE file in the root directory of this source tree. An additional grant
5659 * of patent rights can be found in the PATENTS file in the same directory.
5660 *
5661 * @providesModule ReactComponentEnvironment
5662 */
5663
5664'use strict';
5665
5666var invariant = _dereq_(161);
5667
5668var injected = false;
5669
5670var ReactComponentEnvironment = {
5671
5672 /**
5673 * Optionally injectable environment dependent cleanup hook. (server vs.
5674 * browser etc). Example: A browser system caches DOM nodes based on component
5675 * ID and must remove that cache entry when this instance is unmounted.
5676 */
5677 unmountIDFromEnvironment: null,
5678
5679 /**
5680 * Optionally injectable hook for swapping out mount images in the middle of
5681 * the tree.
5682 */
5683 replaceNodeWithMarkupByID: null,
5684
5685 /**
5686 * Optionally injectable hook for processing a queue of child updates. Will
5687 * later move into MultiChildComponents.
5688 */
5689 processChildrenUpdates: null,
5690
5691 injection: {
5692 injectEnvironment: function (environment) {
5693 !!injected ? "development" !== 'production' ? invariant(false, 'ReactCompositeComponent: injectEnvironment() can only be called once.') : invariant(false) : undefined;
5694 ReactComponentEnvironment.unmountIDFromEnvironment = environment.unmountIDFromEnvironment;
5695 ReactComponentEnvironment.replaceNodeWithMarkupByID = environment.replaceNodeWithMarkupByID;
5696 ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates;
5697 injected = true;
5698 }
5699 }
5700
5701};
5702
5703module.exports = ReactComponentEnvironment;
5704},{"161":161}],37:[function(_dereq_,module,exports){
5705/**
5706 * Copyright 2013-2015, Facebook, Inc.
5707 * All rights reserved.
5708 *
5709 * This source code is licensed under the BSD-style license found in the
5710 * LICENSE file in the root directory of this source tree. An additional grant
5711 * of patent rights can be found in the PATENTS file in the same directory.
5712 *
5713 * @providesModule ReactComponentWithPureRenderMixin
5714 */
5715
5716'use strict';
5717
5718var shallowCompare = _dereq_(140);
5719
5720/**
5721 * If your React component's render function is "pure", e.g. it will render the
5722 * same result given the same props and state, provide this Mixin for a
5723 * considerable performance boost.
5724 *
5725 * Most React components have pure render functions.
5726 *
5727 * Example:
5728 *
5729 * var ReactComponentWithPureRenderMixin =
5730 * require('ReactComponentWithPureRenderMixin');
5731 * React.createClass({
5732 * mixins: [ReactComponentWithPureRenderMixin],
5733 *
5734 * render: function() {
5735 * return <div className={this.props.className}>foo</div>;
5736 * }
5737 * });
5738 *
5739 * Note: This only checks shallow equality for props and state. If these contain
5740 * complex data structures this mixin may have false-negatives for deeper
5741 * differences. Only mixin to components which have simple props and state, or
5742 * use `forceUpdate()` when you know deep data structures have changed.
5743 */
5744var ReactComponentWithPureRenderMixin = {
5745 shouldComponentUpdate: function (nextProps, nextState) {
5746 return shallowCompare(this, nextProps, nextState);
5747 }
5748};
5749
5750module.exports = ReactComponentWithPureRenderMixin;
5751},{"140":140}],38:[function(_dereq_,module,exports){
5752/**
5753 * Copyright 2013-2015, Facebook, Inc.
5754 * All rights reserved.
5755 *
5756 * This source code is licensed under the BSD-style license found in the
5757 * LICENSE file in the root directory of this source tree. An additional grant
5758 * of patent rights can be found in the PATENTS file in the same directory.
5759 *
5760 * @providesModule ReactCompositeComponent
5761 */
5762
5763'use strict';
5764
5765var ReactComponentEnvironment = _dereq_(36);
5766var ReactCurrentOwner = _dereq_(39);
5767var ReactElement = _dereq_(57);
5768var ReactInstanceMap = _dereq_(68);
5769var ReactPerf = _dereq_(78);
5770var ReactPropTypeLocations = _dereq_(81);
5771var ReactPropTypeLocationNames = _dereq_(80);
5772var ReactReconciler = _dereq_(84);
5773var ReactUpdateQueue = _dereq_(95);
5774
5775var assign = _dereq_(24);
5776var emptyObject = _dereq_(154);
5777var invariant = _dereq_(161);
5778var shouldUpdateReactComponent = _dereq_(141);
5779var warning = _dereq_(173);
5780
5781function getDeclarationErrorAddendum(component) {
5782 var owner = component._currentElement._owner || null;
5783 if (owner) {
5784 var name = owner.getName();
5785 if (name) {
5786 return ' Check the render method of `' + name + '`.';
5787 }
5788 }
5789 return '';
5790}
5791
5792function StatelessComponent(Component) {}
5793StatelessComponent.prototype.render = function () {
5794 var Component = ReactInstanceMap.get(this)._currentElement.type;
5795 return Component(this.props, this.context, this.updater);
5796};
5797
5798/**
5799 * ------------------ The Life-Cycle of a Composite Component ------------------
5800 *
5801 * - constructor: Initialization of state. The instance is now retained.
5802 * - componentWillMount
5803 * - render
5804 * - [children's constructors]
5805 * - [children's componentWillMount and render]
5806 * - [children's componentDidMount]
5807 * - componentDidMount
5808 *
5809 * Update Phases:
5810 * - componentWillReceiveProps (only called if parent updated)
5811 * - shouldComponentUpdate
5812 * - componentWillUpdate
5813 * - render
5814 * - [children's constructors or receive props phases]
5815 * - componentDidUpdate
5816 *
5817 * - componentWillUnmount
5818 * - [children's componentWillUnmount]
5819 * - [children destroyed]
5820 * - (destroyed): The instance is now blank, released by React and ready for GC.
5821 *
5822 * -----------------------------------------------------------------------------
5823 */
5824
5825/**
5826 * An incrementing ID assigned to each component when it is mounted. This is
5827 * used to enforce the order in which `ReactUpdates` updates dirty components.
5828 *
5829 * @private
5830 */
5831var nextMountID = 1;
5832
5833/**
5834 * @lends {ReactCompositeComponent.prototype}
5835 */
5836var ReactCompositeComponentMixin = {
5837
5838 /**
5839 * Base constructor for all composite component.
5840 *
5841 * @param {ReactElement} element
5842 * @final
5843 * @internal
5844 */
5845 construct: function (element) {
5846 this._currentElement = element;
5847 this._rootNodeID = null;
5848 this._instance = null;
5849
5850 // See ReactUpdateQueue
5851 this._pendingElement = null;
5852 this._pendingStateQueue = null;
5853 this._pendingReplaceState = false;
5854 this._pendingForceUpdate = false;
5855
5856 this._renderedComponent = null;
5857
5858 this._context = null;
5859 this._mountOrder = 0;
5860 this._topLevelWrapper = null;
5861
5862 // See ReactUpdates and ReactUpdateQueue.
5863 this._pendingCallbacks = null;
5864 },
5865
5866 /**
5867 * Initializes the component, renders markup, and registers event listeners.
5868 *
5869 * @param {string} rootID DOM ID of the root node.
5870 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
5871 * @return {?string} Rendered markup to be inserted into the DOM.
5872 * @final
5873 * @internal
5874 */
5875 mountComponent: function (rootID, transaction, context) {
5876 this._context = context;
5877 this._mountOrder = nextMountID++;
5878 this._rootNodeID = rootID;
5879
5880 var publicProps = this._processProps(this._currentElement.props);
5881 var publicContext = this._processContext(context);
5882
5883 var Component = this._currentElement.type;
5884
5885 // Initialize the public class
5886 var inst;
5887 var renderedElement;
5888
5889 // This is a way to detect if Component is a stateless arrow function
5890 // component, which is not newable. It might not be 100% reliable but is
5891 // something we can do until we start detecting that Component extends
5892 // React.Component. We already assume that typeof Component === 'function'.
5893 var canInstantiate = ('prototype' in Component);
5894
5895 if (canInstantiate) {
5896 if ("development" !== 'production') {
5897 ReactCurrentOwner.current = this;
5898 try {
5899 inst = new Component(publicProps, publicContext, ReactUpdateQueue);
5900 } finally {
5901 ReactCurrentOwner.current = null;
5902 }
5903 } else {
5904 inst = new Component(publicProps, publicContext, ReactUpdateQueue);
5905 }
5906 }
5907
5908 if (!canInstantiate || inst === null || inst === false || ReactElement.isValidElement(inst)) {
5909 renderedElement = inst;
5910 inst = new StatelessComponent(Component);
5911 }
5912
5913 if ("development" !== 'production') {
5914 // This will throw later in _renderValidatedComponent, but add an early
5915 // warning now to help debugging
5916 if (inst.render == null) {
5917 "development" !== 'production' ? warning(false, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`, returned ' + 'null/false from a stateless component, or tried to render an ' + 'element whose type is a function that isn\'t a React component.', Component.displayName || Component.name || 'Component') : undefined;
5918 } else {
5919 // We support ES6 inheriting from React.Component, the module pattern,
5920 // and stateless components, but not ES6 classes that don't extend
5921 "development" !== 'production' ? warning(Component.prototype && Component.prototype.isReactComponent || !canInstantiate || !(inst instanceof Component), '%s(...): React component classes must extend React.Component.', Component.displayName || Component.name || 'Component') : undefined;
5922 }
5923 }
5924
5925 // These should be set up in the constructor, but as a convenience for
5926 // simpler class abstractions, we set them up after the fact.
5927 inst.props = publicProps;
5928 inst.context = publicContext;
5929 inst.refs = emptyObject;
5930 inst.updater = ReactUpdateQueue;
5931
5932 this._instance = inst;
5933
5934 // Store a reference from the instance back to the internal representation
5935 ReactInstanceMap.set(inst, this);
5936
5937 if ("development" !== 'production') {
5938 // Since plain JS classes are defined without any special initialization
5939 // logic, we can not catch common errors early. Therefore, we have to
5940 // catch them here, at initialization time, instead.
5941 "development" !== 'production' ? warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', this.getName() || 'a component') : undefined;
5942 "development" !== 'production' ? warning(!inst.getDefaultProps || inst.getDefaultProps.isReactClassApproved, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', this.getName() || 'a component') : undefined;
5943 "development" !== 'production' ? warning(!inst.propTypes, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', this.getName() || 'a component') : undefined;
5944 "development" !== 'production' ? warning(!inst.contextTypes, 'contextTypes was defined as an instance property on %s. Use a ' + 'static property to define contextTypes instead.', this.getName() || 'a component') : undefined;
5945 "development" !== 'production' ? warning(typeof inst.componentShouldUpdate !== 'function', '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', this.getName() || 'A component') : undefined;
5946 "development" !== 'production' ? warning(typeof inst.componentDidUnmount !== 'function', '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', this.getName() || 'A component') : undefined;
5947 "development" !== 'production' ? warning(typeof inst.componentWillRecieveProps !== 'function', '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', this.getName() || 'A component') : undefined;
5948 }
5949
5950 var initialState = inst.state;
5951 if (initialState === undefined) {
5952 inst.state = initialState = null;
5953 }
5954 !(typeof initialState === 'object' && !Array.isArray(initialState)) ? "development" !== 'production' ? invariant(false, '%s.state: must be set to an object or null', this.getName() || 'ReactCompositeComponent') : invariant(false) : undefined;
5955
5956 this._pendingStateQueue = null;
5957 this._pendingReplaceState = false;
5958 this._pendingForceUpdate = false;
5959
5960 if (inst.componentWillMount) {
5961 inst.componentWillMount();
5962 // When mounting, calls to `setState` by `componentWillMount` will set
5963 // `this._pendingStateQueue` without triggering a re-render.
5964 if (this._pendingStateQueue) {
5965 inst.state = this._processPendingState(inst.props, inst.context);
5966 }
5967 }
5968
5969 // If not a stateless component, we now render
5970 if (renderedElement === undefined) {
5971 renderedElement = this._renderValidatedComponent();
5972 }
5973
5974 this._renderedComponent = this._instantiateReactComponent(renderedElement);
5975
5976 var markup = ReactReconciler.mountComponent(this._renderedComponent, rootID, transaction, this._processChildContext(context));
5977 if (inst.componentDidMount) {
5978 transaction.getReactMountReady().enqueue(inst.componentDidMount, inst);
5979 }
5980
5981 return markup;
5982 },
5983
5984 /**
5985 * Releases any resources allocated by `mountComponent`.
5986 *
5987 * @final
5988 * @internal
5989 */
5990 unmountComponent: function () {
5991 var inst = this._instance;
5992
5993 if (inst.componentWillUnmount) {
5994 inst.componentWillUnmount();
5995 }
5996
5997 ReactReconciler.unmountComponent(this._renderedComponent);
5998 this._renderedComponent = null;
5999 this._instance = null;
6000
6001 // Reset pending fields
6002 // Even if this component is scheduled for another update in ReactUpdates,
6003 // it would still be ignored because these fields are reset.
6004 this._pendingStateQueue = null;
6005 this._pendingReplaceState = false;
6006 this._pendingForceUpdate = false;
6007 this._pendingCallbacks = null;
6008 this._pendingElement = null;
6009
6010 // These fields do not really need to be reset since this object is no
6011 // longer accessible.
6012 this._context = null;
6013 this._rootNodeID = null;
6014 this._topLevelWrapper = null;
6015
6016 // Delete the reference from the instance to this internal representation
6017 // which allow the internals to be properly cleaned up even if the user
6018 // leaks a reference to the public instance.
6019 ReactInstanceMap.remove(inst);
6020
6021 // Some existing components rely on inst.props even after they've been
6022 // destroyed (in event handlers).
6023 // TODO: inst.props = null;
6024 // TODO: inst.state = null;
6025 // TODO: inst.context = null;
6026 },
6027
6028 /**
6029 * Filters the context object to only contain keys specified in
6030 * `contextTypes`
6031 *
6032 * @param {object} context
6033 * @return {?object}
6034 * @private
6035 */
6036 _maskContext: function (context) {
6037 var maskedContext = null;
6038 var Component = this._currentElement.type;
6039 var contextTypes = Component.contextTypes;
6040 if (!contextTypes) {
6041 return emptyObject;
6042 }
6043 maskedContext = {};
6044 for (var contextName in contextTypes) {
6045 maskedContext[contextName] = context[contextName];
6046 }
6047 return maskedContext;
6048 },
6049
6050 /**
6051 * Filters the context object to only contain keys specified in
6052 * `contextTypes`, and asserts that they are valid.
6053 *
6054 * @param {object} context
6055 * @return {?object}
6056 * @private
6057 */
6058 _processContext: function (context) {
6059 var maskedContext = this._maskContext(context);
6060 if ("development" !== 'production') {
6061 var Component = this._currentElement.type;
6062 if (Component.contextTypes) {
6063 this._checkPropTypes(Component.contextTypes, maskedContext, ReactPropTypeLocations.context);
6064 }
6065 }
6066 return maskedContext;
6067 },
6068
6069 /**
6070 * @param {object} currentContext
6071 * @return {object}
6072 * @private
6073 */
6074 _processChildContext: function (currentContext) {
6075 var Component = this._currentElement.type;
6076 var inst = this._instance;
6077 var childContext = inst.getChildContext && inst.getChildContext();
6078 if (childContext) {
6079 !(typeof Component.childContextTypes === 'object') ? "development" !== 'production' ? invariant(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', this.getName() || 'ReactCompositeComponent') : invariant(false) : undefined;
6080 if ("development" !== 'production') {
6081 this._checkPropTypes(Component.childContextTypes, childContext, ReactPropTypeLocations.childContext);
6082 }
6083 for (var name in childContext) {
6084 !(name in Component.childContextTypes) ? "development" !== 'production' ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', this.getName() || 'ReactCompositeComponent', name) : invariant(false) : undefined;
6085 }
6086 return assign({}, currentContext, childContext);
6087 }
6088 return currentContext;
6089 },
6090
6091 /**
6092 * Processes props by setting default values for unspecified props and
6093 * asserting that the props are valid. Does not mutate its argument; returns
6094 * a new props object with defaults merged in.
6095 *
6096 * @param {object} newProps
6097 * @return {object}
6098 * @private
6099 */
6100 _processProps: function (newProps) {
6101 if ("development" !== 'production') {
6102 var Component = this._currentElement.type;
6103 if (Component.propTypes) {
6104 this._checkPropTypes(Component.propTypes, newProps, ReactPropTypeLocations.prop);
6105 }
6106 }
6107 return newProps;
6108 },
6109
6110 /**
6111 * Assert that the props are valid
6112 *
6113 * @param {object} propTypes Map of prop name to a ReactPropType
6114 * @param {object} props
6115 * @param {string} location e.g. "prop", "context", "child context"
6116 * @private
6117 */
6118 _checkPropTypes: function (propTypes, props, location) {
6119 // TODO: Stop validating prop types here and only use the element
6120 // validation.
6121 var componentName = this.getName();
6122 for (var propName in propTypes) {
6123 if (propTypes.hasOwnProperty(propName)) {
6124 var error;
6125 try {
6126 // This is intentionally an invariant that gets caught. It's the same
6127 // behavior as without this statement except with a better message.
6128 !(typeof propTypes[propName] === 'function') ? "development" !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually ' + 'from React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], propName) : invariant(false) : undefined;
6129 error = propTypes[propName](props, propName, componentName, location);
6130 } catch (ex) {
6131 error = ex;
6132 }
6133 if (error instanceof Error) {
6134 // We may want to extend this logic for similar errors in
6135 // top-level render calls, so I'm abstracting it away into
6136 // a function to minimize refactoring in the future
6137 var addendum = getDeclarationErrorAddendum(this);
6138
6139 if (location === ReactPropTypeLocations.prop) {
6140 // Preface gives us something to blacklist in warning module
6141 "development" !== 'production' ? warning(false, 'Failed Composite propType: %s%s', error.message, addendum) : undefined;
6142 } else {
6143 "development" !== 'production' ? warning(false, 'Failed Context Types: %s%s', error.message, addendum) : undefined;
6144 }
6145 }
6146 }
6147 }
6148 },
6149
6150 receiveComponent: function (nextElement, transaction, nextContext) {
6151 var prevElement = this._currentElement;
6152 var prevContext = this._context;
6153
6154 this._pendingElement = null;
6155
6156 this.updateComponent(transaction, prevElement, nextElement, prevContext, nextContext);
6157 },
6158
6159 /**
6160 * If any of `_pendingElement`, `_pendingStateQueue`, or `_pendingForceUpdate`
6161 * is set, update the component.
6162 *
6163 * @param {ReactReconcileTransaction} transaction
6164 * @internal
6165 */
6166 performUpdateIfNecessary: function (transaction) {
6167 if (this._pendingElement != null) {
6168 ReactReconciler.receiveComponent(this, this._pendingElement || this._currentElement, transaction, this._context);
6169 }
6170
6171 if (this._pendingStateQueue !== null || this._pendingForceUpdate) {
6172 this.updateComponent(transaction, this._currentElement, this._currentElement, this._context, this._context);
6173 }
6174 },
6175
6176 /**
6177 * Perform an update to a mounted component. The componentWillReceiveProps and
6178 * shouldComponentUpdate methods are called, then (assuming the update isn't
6179 * skipped) the remaining update lifecycle methods are called and the DOM
6180 * representation is updated.
6181 *
6182 * By default, this implements React's rendering and reconciliation algorithm.
6183 * Sophisticated clients may wish to override this.
6184 *
6185 * @param {ReactReconcileTransaction} transaction
6186 * @param {ReactElement} prevParentElement
6187 * @param {ReactElement} nextParentElement
6188 * @internal
6189 * @overridable
6190 */
6191 updateComponent: function (transaction, prevParentElement, nextParentElement, prevUnmaskedContext, nextUnmaskedContext) {
6192 var inst = this._instance;
6193
6194 var nextContext = this._context === nextUnmaskedContext ? inst.context : this._processContext(nextUnmaskedContext);
6195 var nextProps;
6196
6197 // Distinguish between a props update versus a simple state update
6198 if (prevParentElement === nextParentElement) {
6199 // Skip checking prop types again -- we don't read inst.props to avoid
6200 // warning for DOM component props in this upgrade
6201 nextProps = nextParentElement.props;
6202 } else {
6203 nextProps = this._processProps(nextParentElement.props);
6204 // An update here will schedule an update but immediately set
6205 // _pendingStateQueue which will ensure that any state updates gets
6206 // immediately reconciled instead of waiting for the next batch.
6207
6208 if (inst.componentWillReceiveProps) {
6209 inst.componentWillReceiveProps(nextProps, nextContext);
6210 }
6211 }
6212
6213 var nextState = this._processPendingState(nextProps, nextContext);
6214
6215 var shouldUpdate = this._pendingForceUpdate || !inst.shouldComponentUpdate || inst.shouldComponentUpdate(nextProps, nextState, nextContext);
6216
6217 if ("development" !== 'production') {
6218 "development" !== 'production' ? warning(typeof shouldUpdate !== 'undefined', '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', this.getName() || 'ReactCompositeComponent') : undefined;
6219 }
6220
6221 if (shouldUpdate) {
6222 this._pendingForceUpdate = false;
6223 // Will set `this.props`, `this.state` and `this.context`.
6224 this._performComponentUpdate(nextParentElement, nextProps, nextState, nextContext, transaction, nextUnmaskedContext);
6225 } else {
6226 // If it's determined that a component should not update, we still want
6227 // to set props and state but we shortcut the rest of the update.
6228 this._currentElement = nextParentElement;
6229 this._context = nextUnmaskedContext;
6230 inst.props = nextProps;
6231 inst.state = nextState;
6232 inst.context = nextContext;
6233 }
6234 },
6235
6236 _processPendingState: function (props, context) {
6237 var inst = this._instance;
6238 var queue = this._pendingStateQueue;
6239 var replace = this._pendingReplaceState;
6240 this._pendingReplaceState = false;
6241 this._pendingStateQueue = null;
6242
6243 if (!queue) {
6244 return inst.state;
6245 }
6246
6247 if (replace && queue.length === 1) {
6248 return queue[0];
6249 }
6250
6251 var nextState = assign({}, replace ? queue[0] : inst.state);
6252 for (var i = replace ? 1 : 0; i < queue.length; i++) {
6253 var partial = queue[i];
6254 assign(nextState, typeof partial === 'function' ? partial.call(inst, nextState, props, context) : partial);
6255 }
6256
6257 return nextState;
6258 },
6259
6260 /**
6261 * Merges new props and state, notifies delegate methods of update and
6262 * performs update.
6263 *
6264 * @param {ReactElement} nextElement Next element
6265 * @param {object} nextProps Next public object to set as properties.
6266 * @param {?object} nextState Next object to set as state.
6267 * @param {?object} nextContext Next public object to set as context.
6268 * @param {ReactReconcileTransaction} transaction
6269 * @param {?object} unmaskedContext
6270 * @private
6271 */
6272 _performComponentUpdate: function (nextElement, nextProps, nextState, nextContext, transaction, unmaskedContext) {
6273 var inst = this._instance;
6274
6275 var hasComponentDidUpdate = Boolean(inst.componentDidUpdate);
6276 var prevProps;
6277 var prevState;
6278 var prevContext;
6279 if (hasComponentDidUpdate) {
6280 prevProps = inst.props;
6281 prevState = inst.state;
6282 prevContext = inst.context;
6283 }
6284
6285 if (inst.componentWillUpdate) {
6286 inst.componentWillUpdate(nextProps, nextState, nextContext);
6287 }
6288
6289 this._currentElement = nextElement;
6290 this._context = unmaskedContext;
6291 inst.props = nextProps;
6292 inst.state = nextState;
6293 inst.context = nextContext;
6294
6295 this._updateRenderedComponent(transaction, unmaskedContext);
6296
6297 if (hasComponentDidUpdate) {
6298 transaction.getReactMountReady().enqueue(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), inst);
6299 }
6300 },
6301
6302 /**
6303 * Call the component's `render` method and update the DOM accordingly.
6304 *
6305 * @param {ReactReconcileTransaction} transaction
6306 * @internal
6307 */
6308 _updateRenderedComponent: function (transaction, context) {
6309 var prevComponentInstance = this._renderedComponent;
6310 var prevRenderedElement = prevComponentInstance._currentElement;
6311 var nextRenderedElement = this._renderValidatedComponent();
6312 if (shouldUpdateReactComponent(prevRenderedElement, nextRenderedElement)) {
6313 ReactReconciler.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context));
6314 } else {
6315 // These two IDs are actually the same! But nothing should rely on that.
6316 var thisID = this._rootNodeID;
6317 var prevComponentID = prevComponentInstance._rootNodeID;
6318 ReactReconciler.unmountComponent(prevComponentInstance);
6319
6320 this._renderedComponent = this._instantiateReactComponent(nextRenderedElement);
6321 var nextMarkup = ReactReconciler.mountComponent(this._renderedComponent, thisID, transaction, this._processChildContext(context));
6322 this._replaceNodeWithMarkupByID(prevComponentID, nextMarkup);
6323 }
6324 },
6325
6326 /**
6327 * @protected
6328 */
6329 _replaceNodeWithMarkupByID: function (prevComponentID, nextMarkup) {
6330 ReactComponentEnvironment.replaceNodeWithMarkupByID(prevComponentID, nextMarkup);
6331 },
6332
6333 /**
6334 * @protected
6335 */
6336 _renderValidatedComponentWithoutOwnerOrContext: function () {
6337 var inst = this._instance;
6338 var renderedComponent = inst.render();
6339 if ("development" !== 'production') {
6340 // We allow auto-mocks to proceed as if they're returning null.
6341 if (typeof renderedComponent === 'undefined' && inst.render._isMockFunction) {
6342 // This is probably bad practice. Consider warning here and
6343 // deprecating this convenience.
6344 renderedComponent = null;
6345 }
6346 }
6347
6348 return renderedComponent;
6349 },
6350
6351 /**
6352 * @private
6353 */
6354 _renderValidatedComponent: function () {
6355 var renderedComponent;
6356 ReactCurrentOwner.current = this;
6357 try {
6358 renderedComponent = this._renderValidatedComponentWithoutOwnerOrContext();
6359 } finally {
6360 ReactCurrentOwner.current = null;
6361 }
6362 !(
6363 // TODO: An `isValidNode` function would probably be more appropriate
6364 renderedComponent === null || renderedComponent === false || ReactElement.isValidElement(renderedComponent)) ? "development" !== 'production' ? invariant(false, '%s.render(): A valid ReactComponent must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', this.getName() || 'ReactCompositeComponent') : invariant(false) : undefined;
6365 return renderedComponent;
6366 },
6367
6368 /**
6369 * Lazily allocates the refs object and stores `component` as `ref`.
6370 *
6371 * @param {string} ref Reference name.
6372 * @param {component} component Component to store as `ref`.
6373 * @final
6374 * @private
6375 */
6376 attachRef: function (ref, component) {
6377 var inst = this.getPublicInstance();
6378 !(inst != null) ? "development" !== 'production' ? invariant(false, 'Stateless function components cannot have refs.') : invariant(false) : undefined;
6379 var publicComponentInstance = component.getPublicInstance();
6380 if ("development" !== 'production') {
6381 var componentName = component && component.getName ? component.getName() : 'a component';
6382 "development" !== 'production' ? warning(publicComponentInstance != null, 'Stateless function components cannot be given refs ' + '(See ref "%s" in %s created by %s). ' + 'Attempts to access this ref will fail.', ref, componentName, this.getName()) : undefined;
6383 }
6384 var refs = inst.refs === emptyObject ? inst.refs = {} : inst.refs;
6385 refs[ref] = publicComponentInstance;
6386 },
6387
6388 /**
6389 * Detaches a reference name.
6390 *
6391 * @param {string} ref Name to dereference.
6392 * @final
6393 * @private
6394 */
6395 detachRef: function (ref) {
6396 var refs = this.getPublicInstance().refs;
6397 delete refs[ref];
6398 },
6399
6400 /**
6401 * Get a text description of the component that can be used to identify it
6402 * in error messages.
6403 * @return {string} The name or null.
6404 * @internal
6405 */
6406 getName: function () {
6407 var type = this._currentElement.type;
6408 var constructor = this._instance && this._instance.constructor;
6409 return type.displayName || constructor && constructor.displayName || type.name || constructor && constructor.name || null;
6410 },
6411
6412 /**
6413 * Get the publicly accessible representation of this component - i.e. what
6414 * is exposed by refs and returned by render. Can be null for stateless
6415 * components.
6416 *
6417 * @return {ReactComponent} the public component instance.
6418 * @internal
6419 */
6420 getPublicInstance: function () {
6421 var inst = this._instance;
6422 if (inst instanceof StatelessComponent) {
6423 return null;
6424 }
6425 return inst;
6426 },
6427
6428 // Stub
6429 _instantiateReactComponent: null
6430
6431};
6432
6433ReactPerf.measureMethods(ReactCompositeComponentMixin, 'ReactCompositeComponent', {
6434 mountComponent: 'mountComponent',
6435 updateComponent: 'updateComponent',
6436 _renderValidatedComponent: '_renderValidatedComponent'
6437});
6438
6439var ReactCompositeComponent = {
6440
6441 Mixin: ReactCompositeComponentMixin
6442
6443};
6444
6445module.exports = ReactCompositeComponent;
6446},{"141":141,"154":154,"161":161,"173":173,"24":24,"36":36,"39":39,"57":57,"68":68,"78":78,"80":80,"81":81,"84":84,"95":95}],39:[function(_dereq_,module,exports){
6447/**
6448 * Copyright 2013-2015, Facebook, Inc.
6449 * All rights reserved.
6450 *
6451 * This source code is licensed under the BSD-style license found in the
6452 * LICENSE file in the root directory of this source tree. An additional grant
6453 * of patent rights can be found in the PATENTS file in the same directory.
6454 *
6455 * @providesModule ReactCurrentOwner
6456 */
6457
6458'use strict';
6459
6460/**
6461 * Keeps track of the current owner.
6462 *
6463 * The current owner is the component who should own any components that are
6464 * currently being constructed.
6465 */
6466var ReactCurrentOwner = {
6467
6468 /**
6469 * @internal
6470 * @type {ReactComponent}
6471 */
6472 current: null
6473
6474};
6475
6476module.exports = ReactCurrentOwner;
6477},{}],40:[function(_dereq_,module,exports){
6478/**
6479 * Copyright 2013-2015, Facebook, Inc.
6480 * All rights reserved.
6481 *
6482 * This source code is licensed under the BSD-style license found in the
6483 * LICENSE file in the root directory of this source tree. An additional grant
6484 * of patent rights can be found in the PATENTS file in the same directory.
6485 *
6486 * @providesModule ReactDOM
6487 */
6488
6489/* globals __REACT_DEVTOOLS_GLOBAL_HOOK__*/
6490
6491'use strict';
6492
6493var ReactCurrentOwner = _dereq_(39);
6494var ReactDOMTextComponent = _dereq_(51);
6495var ReactDefaultInjection = _dereq_(54);
6496var ReactInstanceHandles = _dereq_(67);
6497var ReactMount = _dereq_(72);
6498var ReactPerf = _dereq_(78);
6499var ReactReconciler = _dereq_(84);
6500var ReactUpdates = _dereq_(96);
6501var ReactVersion = _dereq_(97);
6502
6503var findDOMNode = _dereq_(122);
6504var renderSubtreeIntoContainer = _dereq_(137);
6505var warning = _dereq_(173);
6506
6507ReactDefaultInjection.inject();
6508
6509var render = ReactPerf.measure('React', 'render', ReactMount.render);
6510
6511var React = {
6512 findDOMNode: findDOMNode,
6513 render: render,
6514 unmountComponentAtNode: ReactMount.unmountComponentAtNode,
6515 version: ReactVersion,
6516
6517 /* eslint-disable camelcase */
6518 unstable_batchedUpdates: ReactUpdates.batchedUpdates,
6519 unstable_renderSubtreeIntoContainer: renderSubtreeIntoContainer
6520};
6521
6522// Inject the runtime into a devtools global hook regardless of browser.
6523// Allows for debugging when the hook is injected on the page.
6524/* eslint-enable camelcase */
6525if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') {
6526 __REACT_DEVTOOLS_GLOBAL_HOOK__.inject({
6527 CurrentOwner: ReactCurrentOwner,
6528 InstanceHandles: ReactInstanceHandles,
6529 Mount: ReactMount,
6530 Reconciler: ReactReconciler,
6531 TextComponent: ReactDOMTextComponent
6532 });
6533}
6534
6535if ("development" !== 'production') {
6536 var ExecutionEnvironment = _dereq_(147);
6537 if (ExecutionEnvironment.canUseDOM && window.top === window.self) {
6538
6539 // First check if devtools is not installed
6540 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
6541 // If we're in Chrome or Firefox, provide a download link if not installed.
6542 if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
6543 console.debug('Download the React DevTools for a better development experience: ' + 'https://fb.me/react-devtools');
6544 }
6545 }
6546
6547 // If we're in IE8, check to see if we are in compatibility mode and provide
6548 // information on preventing compatibility mode
6549 var ieCompatibilityMode = document.documentMode && document.documentMode < 8;
6550
6551 "development" !== 'production' ? warning(!ieCompatibilityMode, 'Internet Explorer is running in compatibility mode; please add the ' + 'following tag to your HTML to prevent this from happening: ' + '<meta http-equiv="X-UA-Compatible" content="IE=edge" />') : undefined;
6552
6553 var expectedFeatures = [
6554 // shims
6555 Array.isArray, Array.prototype.every, Array.prototype.forEach, Array.prototype.indexOf, Array.prototype.map, Date.now, Function.prototype.bind, Object.keys, String.prototype.split, String.prototype.trim,
6556
6557 // shams
6558 Object.create, Object.freeze];
6559
6560 for (var i = 0; i < expectedFeatures.length; i++) {
6561 if (!expectedFeatures[i]) {
6562 console.error('One or more ES5 shim/shams expected by React are not available: ' + 'https://fb.me/react-warning-polyfills');
6563 break;
6564 }
6565 }
6566 }
6567}
6568
6569module.exports = React;
6570},{"122":122,"137":137,"147":147,"173":173,"39":39,"51":51,"54":54,"67":67,"72":72,"78":78,"84":84,"96":96,"97":97}],41:[function(_dereq_,module,exports){
6571/**
6572 * Copyright 2013-2015, Facebook, Inc.
6573 * All rights reserved.
6574 *
6575 * This source code is licensed under the BSD-style license found in the
6576 * LICENSE file in the root directory of this source tree. An additional grant
6577 * of patent rights can be found in the PATENTS file in the same directory.
6578 *
6579 * @providesModule ReactDOMButton
6580 */
6581
6582'use strict';
6583
6584var mouseListenerNames = {
6585 onClick: true,
6586 onDoubleClick: true,
6587 onMouseDown: true,
6588 onMouseMove: true,
6589 onMouseUp: true,
6590
6591 onClickCapture: true,
6592 onDoubleClickCapture: true,
6593 onMouseDownCapture: true,
6594 onMouseMoveCapture: true,
6595 onMouseUpCapture: true
6596};
6597
6598/**
6599 * Implements a <button> native component that does not receive mouse events
6600 * when `disabled` is set.
6601 */
6602var ReactDOMButton = {
6603 getNativeProps: function (inst, props, context) {
6604 if (!props.disabled) {
6605 return props;
6606 }
6607
6608 // Copy the props, except the mouse listeners
6609 var nativeProps = {};
6610 for (var key in props) {
6611 if (props.hasOwnProperty(key) && !mouseListenerNames[key]) {
6612 nativeProps[key] = props[key];
6613 }
6614 }
6615
6616 return nativeProps;
6617 }
6618};
6619
6620module.exports = ReactDOMButton;
6621},{}],42:[function(_dereq_,module,exports){
6622/**
6623 * Copyright 2013-2015, Facebook, Inc.
6624 * All rights reserved.
6625 *
6626 * This source code is licensed under the BSD-style license found in the
6627 * LICENSE file in the root directory of this source tree. An additional grant
6628 * of patent rights can be found in the PATENTS file in the same directory.
6629 *
6630 * @providesModule ReactDOMComponent
6631 * @typechecks static-only
6632 */
6633
6634/* global hasOwnProperty:true */
6635
6636'use strict';
6637
6638var AutoFocusUtils = _dereq_(2);
6639var CSSPropertyOperations = _dereq_(5);
6640var DOMProperty = _dereq_(10);
6641var DOMPropertyOperations = _dereq_(11);
6642var EventConstants = _dereq_(15);
6643var ReactBrowserEventEmitter = _dereq_(28);
6644var ReactComponentBrowserEnvironment = _dereq_(35);
6645var ReactDOMButton = _dereq_(41);
6646var ReactDOMInput = _dereq_(46);
6647var ReactDOMOption = _dereq_(47);
6648var ReactDOMSelect = _dereq_(48);
6649var ReactDOMTextarea = _dereq_(52);
6650var ReactMount = _dereq_(72);
6651var ReactMultiChild = _dereq_(73);
6652var ReactPerf = _dereq_(78);
6653var ReactUpdateQueue = _dereq_(95);
6654
6655var assign = _dereq_(24);
6656var canDefineProperty = _dereq_(117);
6657var escapeTextContentForBrowser = _dereq_(121);
6658var invariant = _dereq_(161);
6659var isEventSupported = _dereq_(133);
6660var keyOf = _dereq_(166);
6661var setInnerHTML = _dereq_(138);
6662var setTextContent = _dereq_(139);
6663var shallowEqual = _dereq_(171);
6664var validateDOMNesting = _dereq_(144);
6665var warning = _dereq_(173);
6666
6667var deleteListener = ReactBrowserEventEmitter.deleteListener;
6668var listenTo = ReactBrowserEventEmitter.listenTo;
6669var registrationNameModules = ReactBrowserEventEmitter.registrationNameModules;
6670
6671// For quickly matching children type, to test if can be treated as content.
6672var CONTENT_TYPES = { 'string': true, 'number': true };
6673
6674var CHILDREN = keyOf({ children: null });
6675var STYLE = keyOf({ style: null });
6676var HTML = keyOf({ __html: null });
6677
6678var ELEMENT_NODE_TYPE = 1;
6679
6680function getDeclarationErrorAddendum(internalInstance) {
6681 if (internalInstance) {
6682 var owner = internalInstance._currentElement._owner || null;
6683 if (owner) {
6684 var name = owner.getName();
6685 if (name) {
6686 return ' This DOM node was rendered by `' + name + '`.';
6687 }
6688 }
6689 }
6690 return '';
6691}
6692
6693var legacyPropsDescriptor;
6694if ("development" !== 'production') {
6695 legacyPropsDescriptor = {
6696 props: {
6697 enumerable: false,
6698 get: function () {
6699 var component = this._reactInternalComponent;
6700 "development" !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .props of a DOM node; instead, ' + 'recreate the props as `render` did originally or read the DOM ' + 'properties/attributes directly from this node (e.g., ' + 'this.refs.box.className).%s', getDeclarationErrorAddendum(component)) : undefined;
6701 return component._currentElement.props;
6702 }
6703 }
6704 };
6705}
6706
6707function legacyGetDOMNode() {
6708 if ("development" !== 'production') {
6709 var component = this._reactInternalComponent;
6710 "development" !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .getDOMNode() of a DOM node; ' + 'instead, use the node directly.%s', getDeclarationErrorAddendum(component)) : undefined;
6711 }
6712 return this;
6713}
6714
6715function legacyIsMounted() {
6716 var component = this._reactInternalComponent;
6717 if ("development" !== 'production') {
6718 "development" !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .isMounted() of a DOM node.%s', getDeclarationErrorAddendum(component)) : undefined;
6719 }
6720 return !!component;
6721}
6722
6723function legacySetStateEtc() {
6724 if ("development" !== 'production') {
6725 var component = this._reactInternalComponent;
6726 "development" !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .setState(), .replaceState(), or ' + '.forceUpdate() of a DOM node. This is a no-op.%s', getDeclarationErrorAddendum(component)) : undefined;
6727 }
6728}
6729
6730function legacySetProps(partialProps, callback) {
6731 var component = this._reactInternalComponent;
6732 if ("development" !== 'production') {
6733 "development" !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .setProps() of a DOM node. ' + 'Instead, call ReactDOM.render again at the top level.%s', getDeclarationErrorAddendum(component)) : undefined;
6734 }
6735 if (!component) {
6736 return;
6737 }
6738 ReactUpdateQueue.enqueueSetPropsInternal(component, partialProps);
6739 if (callback) {
6740 ReactUpdateQueue.enqueueCallbackInternal(component, callback);
6741 }
6742}
6743
6744function legacyReplaceProps(partialProps, callback) {
6745 var component = this._reactInternalComponent;
6746 if ("development" !== 'production') {
6747 "development" !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .replaceProps() of a DOM node. ' + 'Instead, call ReactDOM.render again at the top level.%s', getDeclarationErrorAddendum(component)) : undefined;
6748 }
6749 if (!component) {
6750 return;
6751 }
6752 ReactUpdateQueue.enqueueReplacePropsInternal(component, partialProps);
6753 if (callback) {
6754 ReactUpdateQueue.enqueueCallbackInternal(component, callback);
6755 }
6756}
6757
6758function friendlyStringify(obj) {
6759 if (typeof obj === 'object') {
6760 if (Array.isArray(obj)) {
6761 return '[' + obj.map(friendlyStringify).join(', ') + ']';
6762 } else {
6763 var pairs = [];
6764 for (var key in obj) {
6765 if (Object.prototype.hasOwnProperty.call(obj, key)) {
6766 var keyEscaped = /^[a-z$_][\w$_]*$/i.test(key) ? key : JSON.stringify(key);
6767 pairs.push(keyEscaped + ': ' + friendlyStringify(obj[key]));
6768 }
6769 }
6770 return '{' + pairs.join(', ') + '}';
6771 }
6772 } else if (typeof obj === 'string') {
6773 return JSON.stringify(obj);
6774 } else if (typeof obj === 'function') {
6775 return '[function object]';
6776 }
6777 // Differs from JSON.stringify in that undefined becauses undefined and that
6778 // inf and nan don't become null
6779 return String(obj);
6780}
6781
6782var styleMutationWarning = {};
6783
6784function checkAndWarnForMutatedStyle(style1, style2, component) {
6785 if (style1 == null || style2 == null) {
6786 return;
6787 }
6788 if (shallowEqual(style1, style2)) {
6789 return;
6790 }
6791
6792 var componentName = component._tag;
6793 var owner = component._currentElement._owner;
6794 var ownerName;
6795 if (owner) {
6796 ownerName = owner.getName();
6797 }
6798
6799 var hash = ownerName + '|' + componentName;
6800
6801 if (styleMutationWarning.hasOwnProperty(hash)) {
6802 return;
6803 }
6804
6805 styleMutationWarning[hash] = true;
6806
6807 "development" !== 'production' ? warning(false, '`%s` was passed a style object that has previously been mutated. ' + 'Mutating `style` is deprecated. Consider cloning it beforehand. Check ' + 'the `render` %s. Previous style: %s. Mutated style: %s.', componentName, owner ? 'of `' + ownerName + '`' : 'using <' + componentName + '>', friendlyStringify(style1), friendlyStringify(style2)) : undefined;
6808}
6809
6810/**
6811 * @param {object} component
6812 * @param {?object} props
6813 */
6814function assertValidProps(component, props) {
6815 if (!props) {
6816 return;
6817 }
6818 // Note the use of `==` which checks for null or undefined.
6819 if ("development" !== 'production') {
6820 if (voidElementTags[component._tag]) {
6821 "development" !== 'production' ? warning(props.children == null && props.dangerouslySetInnerHTML == null, '%s is a void element tag and must not have `children` or ' + 'use `props.dangerouslySetInnerHTML`.%s', component._tag, component._currentElement._owner ? ' Check the render method of ' + component._currentElement._owner.getName() + '.' : '') : undefined;
6822 }
6823 }
6824 if (props.dangerouslySetInnerHTML != null) {
6825 !(props.children == null) ? "development" !== 'production' ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : invariant(false) : undefined;
6826 !(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML) ? "development" !== 'production' ? invariant(false, '`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. ' + 'Please visit https://fb.me/react-invariant-dangerously-set-inner-html ' + 'for more information.') : invariant(false) : undefined;
6827 }
6828 if ("development" !== 'production') {
6829 "development" !== 'production' ? warning(props.innerHTML == null, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.') : undefined;
6830 "development" !== 'production' ? warning(!props.contentEditable || props.children == null, 'A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.') : undefined;
6831 }
6832 !(props.style == null || typeof props.style === 'object') ? "development" !== 'production' ? invariant(false, 'The `style` prop expects a mapping from style properties to values, ' + 'not a string. For example, style={{marginRight: spacing + \'em\'}} when ' + 'using JSX.%s', getDeclarationErrorAddendum(component)) : invariant(false) : undefined;
6833}
6834
6835function enqueuePutListener(id, registrationName, listener, transaction) {
6836 if ("development" !== 'production') {
6837 // IE8 has no API for event capturing and the `onScroll` event doesn't
6838 // bubble.
6839 "development" !== 'production' ? warning(registrationName !== 'onScroll' || isEventSupported('scroll', true), 'This browser doesn\'t support the `onScroll` event') : undefined;
6840 }
6841 var container = ReactMount.findReactContainerForID(id);
6842 if (container) {
6843 var doc = container.nodeType === ELEMENT_NODE_TYPE ? container.ownerDocument : container;
6844 listenTo(registrationName, doc);
6845 }
6846 transaction.getReactMountReady().enqueue(putListener, {
6847 id: id,
6848 registrationName: registrationName,
6849 listener: listener
6850 });
6851}
6852
6853function putListener() {
6854 var listenerToPut = this;
6855 ReactBrowserEventEmitter.putListener(listenerToPut.id, listenerToPut.registrationName, listenerToPut.listener);
6856}
6857
6858// There are so many media events, it makes sense to just
6859// maintain a list rather than create a `trapBubbledEvent` for each
6860var mediaEvents = {
6861 topAbort: 'abort',
6862 topCanPlay: 'canplay',
6863 topCanPlayThrough: 'canplaythrough',
6864 topDurationChange: 'durationchange',
6865 topEmptied: 'emptied',
6866 topEncrypted: 'encrypted',
6867 topEnded: 'ended',
6868 topError: 'error',
6869 topLoadedData: 'loadeddata',
6870 topLoadedMetadata: 'loadedmetadata',
6871 topLoadStart: 'loadstart',
6872 topPause: 'pause',
6873 topPlay: 'play',
6874 topPlaying: 'playing',
6875 topProgress: 'progress',
6876 topRateChange: 'ratechange',
6877 topSeeked: 'seeked',
6878 topSeeking: 'seeking',
6879 topStalled: 'stalled',
6880 topSuspend: 'suspend',
6881 topTimeUpdate: 'timeupdate',
6882 topVolumeChange: 'volumechange',
6883 topWaiting: 'waiting'
6884};
6885
6886function trapBubbledEventsLocal() {
6887 var inst = this;
6888 // If a component renders to null or if another component fatals and causes
6889 // the state of the tree to be corrupted, `node` here can be null.
6890 !inst._rootNodeID ? "development" !== 'production' ? invariant(false, 'Must be mounted to trap events') : invariant(false) : undefined;
6891 var node = ReactMount.getNode(inst._rootNodeID);
6892 !node ? "development" !== 'production' ? invariant(false, 'trapBubbledEvent(...): Requires node to be rendered.') : invariant(false) : undefined;
6893
6894 switch (inst._tag) {
6895 case 'iframe':
6896 inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load', node)];
6897 break;
6898 case 'video':
6899 case 'audio':
6900
6901 inst._wrapperState.listeners = [];
6902 // create listener for each media event
6903 for (var event in mediaEvents) {
6904 if (mediaEvents.hasOwnProperty(event)) {
6905 inst._wrapperState.listeners.push(ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes[event], mediaEvents[event], node));
6906 }
6907 }
6908
6909 break;
6910 case 'img':
6911 inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topError, 'error', node), ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load', node)];
6912 break;
6913 case 'form':
6914 inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topReset, 'reset', node), ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topSubmit, 'submit', node)];
6915 break;
6916 }
6917}
6918
6919function mountReadyInputWrapper() {
6920 ReactDOMInput.mountReadyWrapper(this);
6921}
6922
6923function postUpdateSelectWrapper() {
6924 ReactDOMSelect.postUpdateWrapper(this);
6925}
6926
6927// For HTML, certain tags should omit their close tag. We keep a whitelist for
6928// those special cased tags.
6929
6930var omittedCloseTags = {
6931 'area': true,
6932 'base': true,
6933 'br': true,
6934 'col': true,
6935 'embed': true,
6936 'hr': true,
6937 'img': true,
6938 'input': true,
6939 'keygen': true,
6940 'link': true,
6941 'meta': true,
6942 'param': true,
6943 'source': true,
6944 'track': true,
6945 'wbr': true
6946};
6947
6948// NOTE: menuitem's close tag should be omitted, but that causes problems.
6949var newlineEatingTags = {
6950 'listing': true,
6951 'pre': true,
6952 'textarea': true
6953};
6954
6955// For HTML, certain tags cannot have children. This has the same purpose as
6956// `omittedCloseTags` except that `menuitem` should still have its closing tag.
6957
6958var voidElementTags = assign({
6959 'menuitem': true
6960}, omittedCloseTags);
6961
6962// We accept any tag to be rendered but since this gets injected into arbitrary
6963// HTML, we want to make sure that it's a safe tag.
6964// http://www.w3.org/TR/REC-xml/#NT-Name
6965
6966var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/; // Simplified subset
6967var validatedTagCache = {};
6968var hasOwnProperty = ({}).hasOwnProperty;
6969
6970function validateDangerousTag(tag) {
6971 if (!hasOwnProperty.call(validatedTagCache, tag)) {
6972 !VALID_TAG_REGEX.test(tag) ? "development" !== 'production' ? invariant(false, 'Invalid tag: %s', tag) : invariant(false) : undefined;
6973 validatedTagCache[tag] = true;
6974 }
6975}
6976
6977function processChildContextDev(context, inst) {
6978 // Pass down our tag name to child components for validation purposes
6979 context = assign({}, context);
6980 var info = context[validateDOMNesting.ancestorInfoContextKey];
6981 context[validateDOMNesting.ancestorInfoContextKey] = validateDOMNesting.updatedAncestorInfo(info, inst._tag, inst);
6982 return context;
6983}
6984
6985function isCustomComponent(tagName, props) {
6986 return tagName.indexOf('-') >= 0 || props.is != null;
6987}
6988
6989/**
6990 * Creates a new React class that is idempotent and capable of containing other
6991 * React components. It accepts event listeners and DOM properties that are
6992 * valid according to `DOMProperty`.
6993 *
6994 * - Event listeners: `onClick`, `onMouseDown`, etc.
6995 * - DOM properties: `className`, `name`, `title`, etc.
6996 *
6997 * The `style` property functions differently from the DOM API. It accepts an
6998 * object mapping of style properties to values.
6999 *
7000 * @constructor ReactDOMComponent
7001 * @extends ReactMultiChild
7002 */
7003function ReactDOMComponent(tag) {
7004 validateDangerousTag(tag);
7005 this._tag = tag.toLowerCase();
7006 this._renderedChildren = null;
7007 this._previousStyle = null;
7008 this._previousStyleCopy = null;
7009 this._rootNodeID = null;
7010 this._wrapperState = null;
7011 this._topLevelWrapper = null;
7012 this._nodeWithLegacyProperties = null;
7013 if ("development" !== 'production') {
7014 this._unprocessedContextDev = null;
7015 this._processedContextDev = null;
7016 }
7017}
7018
7019ReactDOMComponent.displayName = 'ReactDOMComponent';
7020
7021ReactDOMComponent.Mixin = {
7022
7023 construct: function (element) {
7024 this._currentElement = element;
7025 },
7026
7027 /**
7028 * Generates root tag markup then recurses. This method has side effects and
7029 * is not idempotent.
7030 *
7031 * @internal
7032 * @param {string} rootID The root DOM ID for this node.
7033 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
7034 * @param {object} context
7035 * @return {string} The computed markup.
7036 */
7037 mountComponent: function (rootID, transaction, context) {
7038 this._rootNodeID = rootID;
7039
7040 var props = this._currentElement.props;
7041
7042 switch (this._tag) {
7043 case 'iframe':
7044 case 'img':
7045 case 'form':
7046 case 'video':
7047 case 'audio':
7048 this._wrapperState = {
7049 listeners: null
7050 };
7051 transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
7052 break;
7053 case 'button':
7054 props = ReactDOMButton.getNativeProps(this, props, context);
7055 break;
7056 case 'input':
7057 ReactDOMInput.mountWrapper(this, props, context);
7058 props = ReactDOMInput.getNativeProps(this, props, context);
7059 break;
7060 case 'option':
7061 ReactDOMOption.mountWrapper(this, props, context);
7062 props = ReactDOMOption.getNativeProps(this, props, context);
7063 break;
7064 case 'select':
7065 ReactDOMSelect.mountWrapper(this, props, context);
7066 props = ReactDOMSelect.getNativeProps(this, props, context);
7067 context = ReactDOMSelect.processChildContext(this, props, context);
7068 break;
7069 case 'textarea':
7070 ReactDOMTextarea.mountWrapper(this, props, context);
7071 props = ReactDOMTextarea.getNativeProps(this, props, context);
7072 break;
7073 }
7074
7075 assertValidProps(this, props);
7076 if ("development" !== 'production') {
7077 if (context[validateDOMNesting.ancestorInfoContextKey]) {
7078 validateDOMNesting(this._tag, this, context[validateDOMNesting.ancestorInfoContextKey]);
7079 }
7080 }
7081
7082 if ("development" !== 'production') {
7083 this._unprocessedContextDev = context;
7084 this._processedContextDev = processChildContextDev(context, this);
7085 context = this._processedContextDev;
7086 }
7087
7088 var mountImage;
7089 if (transaction.useCreateElement) {
7090 var ownerDocument = context[ReactMount.ownerDocumentContextKey];
7091 var el = ownerDocument.createElement(this._currentElement.type);
7092 DOMPropertyOperations.setAttributeForID(el, this._rootNodeID);
7093 // Populate node cache
7094 ReactMount.getID(el);
7095 this._updateDOMProperties({}, props, transaction, el);
7096 this._createInitialChildren(transaction, props, context, el);
7097 mountImage = el;
7098 } else {
7099 var tagOpen = this._createOpenTagMarkupAndPutListeners(transaction, props);
7100 var tagContent = this._createContentMarkup(transaction, props, context);
7101 if (!tagContent && omittedCloseTags[this._tag]) {
7102 mountImage = tagOpen + '/>';
7103 } else {
7104 mountImage = tagOpen + '>' + tagContent + '</' + this._currentElement.type + '>';
7105 }
7106 }
7107
7108 switch (this._tag) {
7109 case 'input':
7110 transaction.getReactMountReady().enqueue(mountReadyInputWrapper, this);
7111 // falls through
7112 case 'button':
7113 case 'select':
7114 case 'textarea':
7115 if (props.autoFocus) {
7116 transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
7117 }
7118 break;
7119 }
7120
7121 return mountImage;
7122 },
7123
7124 /**
7125 * Creates markup for the open tag and all attributes.
7126 *
7127 * This method has side effects because events get registered.
7128 *
7129 * Iterating over object properties is faster than iterating over arrays.
7130 * @see http://jsperf.com/obj-vs-arr-iteration
7131 *
7132 * @private
7133 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
7134 * @param {object} props
7135 * @return {string} Markup of opening tag.
7136 */
7137 _createOpenTagMarkupAndPutListeners: function (transaction, props) {
7138 var ret = '<' + this._currentElement.type;
7139
7140 for (var propKey in props) {
7141 if (!props.hasOwnProperty(propKey)) {
7142 continue;
7143 }
7144 var propValue = props[propKey];
7145 if (propValue == null) {
7146 continue;
7147 }
7148 if (registrationNameModules.hasOwnProperty(propKey)) {
7149 if (propValue) {
7150 enqueuePutListener(this._rootNodeID, propKey, propValue, transaction);
7151 }
7152 } else {
7153 if (propKey === STYLE) {
7154 if (propValue) {
7155 if ("development" !== 'production') {
7156 // See `_updateDOMProperties`. style block
7157 this._previousStyle = propValue;
7158 }
7159 propValue = this._previousStyleCopy = assign({}, props.style);
7160 }
7161 propValue = CSSPropertyOperations.createMarkupForStyles(propValue);
7162 }
7163 var markup = null;
7164 if (this._tag != null && isCustomComponent(this._tag, props)) {
7165 if (propKey !== CHILDREN) {
7166 markup = DOMPropertyOperations.createMarkupForCustomAttribute(propKey, propValue);
7167 }
7168 } else {
7169 markup = DOMPropertyOperations.createMarkupForProperty(propKey, propValue);
7170 }
7171 if (markup) {
7172 ret += ' ' + markup;
7173 }
7174 }
7175 }
7176
7177 // For static pages, no need to put React ID and checksum. Saves lots of
7178 // bytes.
7179 if (transaction.renderToStaticMarkup) {
7180 return ret;
7181 }
7182
7183 var markupForID = DOMPropertyOperations.createMarkupForID(this._rootNodeID);
7184 return ret + ' ' + markupForID;
7185 },
7186
7187 /**
7188 * Creates markup for the content between the tags.
7189 *
7190 * @private
7191 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
7192 * @param {object} props
7193 * @param {object} context
7194 * @return {string} Content markup.
7195 */
7196 _createContentMarkup: function (transaction, props, context) {
7197 var ret = '';
7198
7199 // Intentional use of != to avoid catching zero/false.
7200 var innerHTML = props.dangerouslySetInnerHTML;
7201 if (innerHTML != null) {
7202 if (innerHTML.__html != null) {
7203 ret = innerHTML.__html;
7204 }
7205 } else {
7206 var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
7207 var childrenToUse = contentToUse != null ? null : props.children;
7208 if (contentToUse != null) {
7209 // TODO: Validate that text is allowed as a child of this node
7210 ret = escapeTextContentForBrowser(contentToUse);
7211 } else if (childrenToUse != null) {
7212 var mountImages = this.mountChildren(childrenToUse, transaction, context);
7213 ret = mountImages.join('');
7214 }
7215 }
7216 if (newlineEatingTags[this._tag] && ret.charAt(0) === '\n') {
7217 // text/html ignores the first character in these tags if it's a newline
7218 // Prefer to break application/xml over text/html (for now) by adding
7219 // a newline specifically to get eaten by the parser. (Alternately for
7220 // textareas, replacing "^\n" with "\r\n" doesn't get eaten, and the first
7221 // \r is normalized out by HTMLTextAreaElement#value.)
7222 // See: <http://www.w3.org/TR/html-polyglot/#newlines-in-textarea-and-pre>
7223 // See: <http://www.w3.org/TR/html5/syntax.html#element-restrictions>
7224 // See: <http://www.w3.org/TR/html5/syntax.html#newlines>
7225 // See: Parsing of "textarea" "listing" and "pre" elements
7226 // from <http://www.w3.org/TR/html5/syntax.html#parsing-main-inbody>
7227 return '\n' + ret;
7228 } else {
7229 return ret;
7230 }
7231 },
7232
7233 _createInitialChildren: function (transaction, props, context, el) {
7234 // Intentional use of != to avoid catching zero/false.
7235 var innerHTML = props.dangerouslySetInnerHTML;
7236 if (innerHTML != null) {
7237 if (innerHTML.__html != null) {
7238 setInnerHTML(el, innerHTML.__html);
7239 }
7240 } else {
7241 var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
7242 var childrenToUse = contentToUse != null ? null : props.children;
7243 if (contentToUse != null) {
7244 // TODO: Validate that text is allowed as a child of this node
7245 setTextContent(el, contentToUse);
7246 } else if (childrenToUse != null) {
7247 var mountImages = this.mountChildren(childrenToUse, transaction, context);
7248 for (var i = 0; i < mountImages.length; i++) {
7249 el.appendChild(mountImages[i]);
7250 }
7251 }
7252 }
7253 },
7254
7255 /**
7256 * Receives a next element and updates the component.
7257 *
7258 * @internal
7259 * @param {ReactElement} nextElement
7260 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
7261 * @param {object} context
7262 */
7263 receiveComponent: function (nextElement, transaction, context) {
7264 var prevElement = this._currentElement;
7265 this._currentElement = nextElement;
7266 this.updateComponent(transaction, prevElement, nextElement, context);
7267 },
7268
7269 /**
7270 * Updates a native DOM component after it has already been allocated and
7271 * attached to the DOM. Reconciles the root DOM node, then recurses.
7272 *
7273 * @param {ReactReconcileTransaction} transaction
7274 * @param {ReactElement} prevElement
7275 * @param {ReactElement} nextElement
7276 * @internal
7277 * @overridable
7278 */
7279 updateComponent: function (transaction, prevElement, nextElement, context) {
7280 var lastProps = prevElement.props;
7281 var nextProps = this._currentElement.props;
7282
7283 switch (this._tag) {
7284 case 'button':
7285 lastProps = ReactDOMButton.getNativeProps(this, lastProps);
7286 nextProps = ReactDOMButton.getNativeProps(this, nextProps);
7287 break;
7288 case 'input':
7289 ReactDOMInput.updateWrapper(this);
7290 lastProps = ReactDOMInput.getNativeProps(this, lastProps);
7291 nextProps = ReactDOMInput.getNativeProps(this, nextProps);
7292 break;
7293 case 'option':
7294 lastProps = ReactDOMOption.getNativeProps(this, lastProps);
7295 nextProps = ReactDOMOption.getNativeProps(this, nextProps);
7296 break;
7297 case 'select':
7298 lastProps = ReactDOMSelect.getNativeProps(this, lastProps);
7299 nextProps = ReactDOMSelect.getNativeProps(this, nextProps);
7300 break;
7301 case 'textarea':
7302 ReactDOMTextarea.updateWrapper(this);
7303 lastProps = ReactDOMTextarea.getNativeProps(this, lastProps);
7304 nextProps = ReactDOMTextarea.getNativeProps(this, nextProps);
7305 break;
7306 }
7307
7308 if ("development" !== 'production') {
7309 // If the context is reference-equal to the old one, pass down the same
7310 // processed object so the update bailout in ReactReconciler behaves
7311 // correctly (and identically in dev and prod). See #5005.
7312 if (this._unprocessedContextDev !== context) {
7313 this._unprocessedContextDev = context;
7314 this._processedContextDev = processChildContextDev(context, this);
7315 }
7316 context = this._processedContextDev;
7317 }
7318
7319 assertValidProps(this, nextProps);
7320 this._updateDOMProperties(lastProps, nextProps, transaction, null);
7321 this._updateDOMChildren(lastProps, nextProps, transaction, context);
7322
7323 if (!canDefineProperty && this._nodeWithLegacyProperties) {
7324 this._nodeWithLegacyProperties.props = nextProps;
7325 }
7326
7327 if (this._tag === 'select') {
7328 // <select> value update needs to occur after <option> children
7329 // reconciliation
7330 transaction.getReactMountReady().enqueue(postUpdateSelectWrapper, this);
7331 }
7332 },
7333
7334 /**
7335 * Reconciles the properties by detecting differences in property values and
7336 * updating the DOM as necessary. This function is probably the single most
7337 * critical path for performance optimization.
7338 *
7339 * TODO: Benchmark whether checking for changed values in memory actually
7340 * improves performance (especially statically positioned elements).
7341 * TODO: Benchmark the effects of putting this at the top since 99% of props
7342 * do not change for a given reconciliation.
7343 * TODO: Benchmark areas that can be improved with caching.
7344 *
7345 * @private
7346 * @param {object} lastProps
7347 * @param {object} nextProps
7348 * @param {ReactReconcileTransaction} transaction
7349 * @param {?DOMElement} node
7350 */
7351 _updateDOMProperties: function (lastProps, nextProps, transaction, node) {
7352 var propKey;
7353 var styleName;
7354 var styleUpdates;
7355 for (propKey in lastProps) {
7356 if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey)) {
7357 continue;
7358 }
7359 if (propKey === STYLE) {
7360 var lastStyle = this._previousStyleCopy;
7361 for (styleName in lastStyle) {
7362 if (lastStyle.hasOwnProperty(styleName)) {
7363 styleUpdates = styleUpdates || {};
7364 styleUpdates[styleName] = '';
7365 }
7366 }
7367 this._previousStyleCopy = null;
7368 } else if (registrationNameModules.hasOwnProperty(propKey)) {
7369 if (lastProps[propKey]) {
7370 // Only call deleteListener if there was a listener previously or
7371 // else willDeleteListener gets called when there wasn't actually a
7372 // listener (e.g., onClick={null})
7373 deleteListener(this._rootNodeID, propKey);
7374 }
7375 } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
7376 if (!node) {
7377 node = ReactMount.getNode(this._rootNodeID);
7378 }
7379 DOMPropertyOperations.deleteValueForProperty(node, propKey);
7380 }
7381 }
7382 for (propKey in nextProps) {
7383 var nextProp = nextProps[propKey];
7384 var lastProp = propKey === STYLE ? this._previousStyleCopy : lastProps[propKey];
7385 if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp) {
7386 continue;
7387 }
7388 if (propKey === STYLE) {
7389 if (nextProp) {
7390 if ("development" !== 'production') {
7391 checkAndWarnForMutatedStyle(this._previousStyleCopy, this._previousStyle, this);
7392 this._previousStyle = nextProp;
7393 }
7394 nextProp = this._previousStyleCopy = assign({}, nextProp);
7395 } else {
7396 this._previousStyleCopy = null;
7397 }
7398 if (lastProp) {
7399 // Unset styles on `lastProp` but not on `nextProp`.
7400 for (styleName in lastProp) {
7401 if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
7402 styleUpdates = styleUpdates || {};
7403 styleUpdates[styleName] = '';
7404 }
7405 }
7406 // Update styles that changed since `lastProp`.
7407 for (styleName in nextProp) {
7408 if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
7409 styleUpdates = styleUpdates || {};
7410 styleUpdates[styleName] = nextProp[styleName];
7411 }
7412 }
7413 } else {
7414 // Relies on `updateStylesByID` not mutating `styleUpdates`.
7415 styleUpdates = nextProp;
7416 }
7417 } else if (registrationNameModules.hasOwnProperty(propKey)) {
7418 if (nextProp) {
7419 enqueuePutListener(this._rootNodeID, propKey, nextProp, transaction);
7420 } else if (lastProp) {
7421 deleteListener(this._rootNodeID, propKey);
7422 }
7423 } else if (isCustomComponent(this._tag, nextProps)) {
7424 if (!node) {
7425 node = ReactMount.getNode(this._rootNodeID);
7426 }
7427 if (propKey === CHILDREN) {
7428 nextProp = null;
7429 }
7430 DOMPropertyOperations.setValueForAttribute(node, propKey, nextProp);
7431 } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
7432 if (!node) {
7433 node = ReactMount.getNode(this._rootNodeID);
7434 }
7435 // If we're updating to null or undefined, we should remove the property
7436 // from the DOM node instead of inadvertantly setting to a string. This
7437 // brings us in line with the same behavior we have on initial render.
7438 if (nextProp != null) {
7439 DOMPropertyOperations.setValueForProperty(node, propKey, nextProp);
7440 } else {
7441 DOMPropertyOperations.deleteValueForProperty(node, propKey);
7442 }
7443 }
7444 }
7445 if (styleUpdates) {
7446 if (!node) {
7447 node = ReactMount.getNode(this._rootNodeID);
7448 }
7449 CSSPropertyOperations.setValueForStyles(node, styleUpdates);
7450 }
7451 },
7452
7453 /**
7454 * Reconciles the children with the various properties that affect the
7455 * children content.
7456 *
7457 * @param {object} lastProps
7458 * @param {object} nextProps
7459 * @param {ReactReconcileTransaction} transaction
7460 * @param {object} context
7461 */
7462 _updateDOMChildren: function (lastProps, nextProps, transaction, context) {
7463 var lastContent = CONTENT_TYPES[typeof lastProps.children] ? lastProps.children : null;
7464 var nextContent = CONTENT_TYPES[typeof nextProps.children] ? nextProps.children : null;
7465
7466 var lastHtml = lastProps.dangerouslySetInnerHTML && lastProps.dangerouslySetInnerHTML.__html;
7467 var nextHtml = nextProps.dangerouslySetInnerHTML && nextProps.dangerouslySetInnerHTML.__html;
7468
7469 // Note the use of `!=` which checks for null or undefined.
7470 var lastChildren = lastContent != null ? null : lastProps.children;
7471 var nextChildren = nextContent != null ? null : nextProps.children;
7472
7473 // If we're switching from children to content/html or vice versa, remove
7474 // the old content
7475 var lastHasContentOrHtml = lastContent != null || lastHtml != null;
7476 var nextHasContentOrHtml = nextContent != null || nextHtml != null;
7477 if (lastChildren != null && nextChildren == null) {
7478 this.updateChildren(null, transaction, context);
7479 } else if (lastHasContentOrHtml && !nextHasContentOrHtml) {
7480 this.updateTextContent('');
7481 }
7482
7483 if (nextContent != null) {
7484 if (lastContent !== nextContent) {
7485 this.updateTextContent('' + nextContent);
7486 }
7487 } else if (nextHtml != null) {
7488 if (lastHtml !== nextHtml) {
7489 this.updateMarkup('' + nextHtml);
7490 }
7491 } else if (nextChildren != null) {
7492 this.updateChildren(nextChildren, transaction, context);
7493 }
7494 },
7495
7496 /**
7497 * Destroys all event registrations for this instance. Does not remove from
7498 * the DOM. That must be done by the parent.
7499 *
7500 * @internal
7501 */
7502 unmountComponent: function () {
7503 switch (this._tag) {
7504 case 'iframe':
7505 case 'img':
7506 case 'form':
7507 case 'video':
7508 case 'audio':
7509 var listeners = this._wrapperState.listeners;
7510 if (listeners) {
7511 for (var i = 0; i < listeners.length; i++) {
7512 listeners[i].remove();
7513 }
7514 }
7515 break;
7516 case 'input':
7517 ReactDOMInput.unmountWrapper(this);
7518 break;
7519 case 'html':
7520 case 'head':
7521 case 'body':
7522 /**
7523 * Components like <html> <head> and <body> can't be removed or added
7524 * easily in a cross-browser way, however it's valuable to be able to
7525 * take advantage of React's reconciliation for styling and <title>
7526 * management. So we just document it and throw in dangerous cases.
7527 */
7528 !false ? "development" !== 'production' ? invariant(false, '<%s> tried to unmount. Because of cross-browser quirks it is ' + 'impossible to unmount some top-level components (eg <html>, ' + '<head>, and <body>) reliably and efficiently. To fix this, have a ' + 'single top-level component that never unmounts render these ' + 'elements.', this._tag) : invariant(false) : undefined;
7529 break;
7530 }
7531
7532 this.unmountChildren();
7533 ReactBrowserEventEmitter.deleteAllListeners(this._rootNodeID);
7534 ReactComponentBrowserEnvironment.unmountIDFromEnvironment(this._rootNodeID);
7535 this._rootNodeID = null;
7536 this._wrapperState = null;
7537 if (this._nodeWithLegacyProperties) {
7538 var node = this._nodeWithLegacyProperties;
7539 node._reactInternalComponent = null;
7540 this._nodeWithLegacyProperties = null;
7541 }
7542 },
7543
7544 getPublicInstance: function () {
7545 if (!this._nodeWithLegacyProperties) {
7546 var node = ReactMount.getNode(this._rootNodeID);
7547
7548 node._reactInternalComponent = this;
7549 node.getDOMNode = legacyGetDOMNode;
7550 node.isMounted = legacyIsMounted;
7551 node.setState = legacySetStateEtc;
7552 node.replaceState = legacySetStateEtc;
7553 node.forceUpdate = legacySetStateEtc;
7554 node.setProps = legacySetProps;
7555 node.replaceProps = legacyReplaceProps;
7556
7557 if ("development" !== 'production') {
7558 if (canDefineProperty) {
7559 Object.defineProperties(node, legacyPropsDescriptor);
7560 } else {
7561 // updateComponent will update this property on subsequent renders
7562 node.props = this._currentElement.props;
7563 }
7564 } else {
7565 // updateComponent will update this property on subsequent renders
7566 node.props = this._currentElement.props;
7567 }
7568
7569 this._nodeWithLegacyProperties = node;
7570 }
7571 return this._nodeWithLegacyProperties;
7572 }
7573
7574};
7575
7576ReactPerf.measureMethods(ReactDOMComponent, 'ReactDOMComponent', {
7577 mountComponent: 'mountComponent',
7578 updateComponent: 'updateComponent'
7579});
7580
7581assign(ReactDOMComponent.prototype, ReactDOMComponent.Mixin, ReactMultiChild.Mixin);
7582
7583module.exports = ReactDOMComponent;
7584},{"10":10,"11":11,"117":117,"121":121,"133":133,"138":138,"139":139,"144":144,"15":15,"161":161,"166":166,"171":171,"173":173,"2":2,"24":24,"28":28,"35":35,"41":41,"46":46,"47":47,"48":48,"5":5,"52":52,"72":72,"73":73,"78":78,"95":95}],43:[function(_dereq_,module,exports){
7585/**
7586 * Copyright 2013-2015, Facebook, Inc.
7587 * All rights reserved.
7588 *
7589 * This source code is licensed under the BSD-style license found in the
7590 * LICENSE file in the root directory of this source tree. An additional grant
7591 * of patent rights can be found in the PATENTS file in the same directory.
7592 *
7593 * @providesModule ReactDOMFactories
7594 * @typechecks static-only
7595 */
7596
7597'use strict';
7598
7599var ReactElement = _dereq_(57);
7600var ReactElementValidator = _dereq_(58);
7601
7602var mapObject = _dereq_(167);
7603
7604/**
7605 * Create a factory that creates HTML tag elements.
7606 *
7607 * @param {string} tag Tag name (e.g. `div`).
7608 * @private
7609 */
7610function createDOMFactory(tag) {
7611 if ("development" !== 'production') {
7612 return ReactElementValidator.createFactory(tag);
7613 }
7614 return ReactElement.createFactory(tag);
7615}
7616
7617/**
7618 * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes.
7619 * This is also accessible via `React.DOM`.
7620 *
7621 * @public
7622 */
7623var ReactDOMFactories = mapObject({
7624 a: 'a',
7625 abbr: 'abbr',
7626 address: 'address',
7627 area: 'area',
7628 article: 'article',
7629 aside: 'aside',
7630 audio: 'audio',
7631 b: 'b',
7632 base: 'base',
7633 bdi: 'bdi',
7634 bdo: 'bdo',
7635 big: 'big',
7636 blockquote: 'blockquote',
7637 body: 'body',
7638 br: 'br',
7639 button: 'button',
7640 canvas: 'canvas',
7641 caption: 'caption',
7642 cite: 'cite',
7643 code: 'code',
7644 col: 'col',
7645 colgroup: 'colgroup',
7646 data: 'data',
7647 datalist: 'datalist',
7648 dd: 'dd',
7649 del: 'del',
7650 details: 'details',
7651 dfn: 'dfn',
7652 dialog: 'dialog',
7653 div: 'div',
7654 dl: 'dl',
7655 dt: 'dt',
7656 em: 'em',
7657 embed: 'embed',
7658 fieldset: 'fieldset',
7659 figcaption: 'figcaption',
7660 figure: 'figure',
7661 footer: 'footer',
7662 form: 'form',
7663 h1: 'h1',
7664 h2: 'h2',
7665 h3: 'h3',
7666 h4: 'h4',
7667 h5: 'h5',
7668 h6: 'h6',
7669 head: 'head',
7670 header: 'header',
7671 hgroup: 'hgroup',
7672 hr: 'hr',
7673 html: 'html',
7674 i: 'i',
7675 iframe: 'iframe',
7676 img: 'img',
7677 input: 'input',
7678 ins: 'ins',
7679 kbd: 'kbd',
7680 keygen: 'keygen',
7681 label: 'label',
7682 legend: 'legend',
7683 li: 'li',
7684 link: 'link',
7685 main: 'main',
7686 map: 'map',
7687 mark: 'mark',
7688 menu: 'menu',
7689 menuitem: 'menuitem',
7690 meta: 'meta',
7691 meter: 'meter',
7692 nav: 'nav',
7693 noscript: 'noscript',
7694 object: 'object',
7695 ol: 'ol',
7696 optgroup: 'optgroup',
7697 option: 'option',
7698 output: 'output',
7699 p: 'p',
7700 param: 'param',
7701 picture: 'picture',
7702 pre: 'pre',
7703 progress: 'progress',
7704 q: 'q',
7705 rp: 'rp',
7706 rt: 'rt',
7707 ruby: 'ruby',
7708 s: 's',
7709 samp: 'samp',
7710 script: 'script',
7711 section: 'section',
7712 select: 'select',
7713 small: 'small',
7714 source: 'source',
7715 span: 'span',
7716 strong: 'strong',
7717 style: 'style',
7718 sub: 'sub',
7719 summary: 'summary',
7720 sup: 'sup',
7721 table: 'table',
7722 tbody: 'tbody',
7723 td: 'td',
7724 textarea: 'textarea',
7725 tfoot: 'tfoot',
7726 th: 'th',
7727 thead: 'thead',
7728 time: 'time',
7729 title: 'title',
7730 tr: 'tr',
7731 track: 'track',
7732 u: 'u',
7733 ul: 'ul',
7734 'var': 'var',
7735 video: 'video',
7736 wbr: 'wbr',
7737
7738 // SVG
7739 circle: 'circle',
7740 clipPath: 'clipPath',
7741 defs: 'defs',
7742 ellipse: 'ellipse',
7743 g: 'g',
7744 image: 'image',
7745 line: 'line',
7746 linearGradient: 'linearGradient',
7747 mask: 'mask',
7748 path: 'path',
7749 pattern: 'pattern',
7750 polygon: 'polygon',
7751 polyline: 'polyline',
7752 radialGradient: 'radialGradient',
7753 rect: 'rect',
7754 stop: 'stop',
7755 svg: 'svg',
7756 text: 'text',
7757 tspan: 'tspan'
7758
7759}, createDOMFactory);
7760
7761module.exports = ReactDOMFactories;
7762},{"167":167,"57":57,"58":58}],44:[function(_dereq_,module,exports){
7763/**
7764 * Copyright 2013-2015, Facebook, Inc.
7765 * All rights reserved.
7766 *
7767 * This source code is licensed under the BSD-style license found in the
7768 * LICENSE file in the root directory of this source tree. An additional grant
7769 * of patent rights can be found in the PATENTS file in the same directory.
7770 *
7771 * @providesModule ReactDOMFeatureFlags
7772 */
7773
7774'use strict';
7775
7776var ReactDOMFeatureFlags = {
7777 useCreateElement: false
7778};
7779
7780module.exports = ReactDOMFeatureFlags;
7781},{}],45:[function(_dereq_,module,exports){
7782/**
7783 * Copyright 2013-2015, Facebook, Inc.
7784 * All rights reserved.
7785 *
7786 * This source code is licensed under the BSD-style license found in the
7787 * LICENSE file in the root directory of this source tree. An additional grant
7788 * of patent rights can be found in the PATENTS file in the same directory.
7789 *
7790 * @providesModule ReactDOMIDOperations
7791 * @typechecks static-only
7792 */
7793
7794'use strict';
7795
7796var DOMChildrenOperations = _dereq_(9);
7797var DOMPropertyOperations = _dereq_(11);
7798var ReactMount = _dereq_(72);
7799var ReactPerf = _dereq_(78);
7800
7801var invariant = _dereq_(161);
7802
7803/**
7804 * Errors for properties that should not be updated with `updatePropertyByID()`.
7805 *
7806 * @type {object}
7807 * @private
7808 */
7809var INVALID_PROPERTY_ERRORS = {
7810 dangerouslySetInnerHTML: '`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.',
7811 style: '`style` must be set using `updateStylesByID()`.'
7812};
7813
7814/**
7815 * Operations used to process updates to DOM nodes.
7816 */
7817var ReactDOMIDOperations = {
7818
7819 /**
7820 * Updates a DOM node with new property values. This should only be used to
7821 * update DOM properties in `DOMProperty`.
7822 *
7823 * @param {string} id ID of the node to update.
7824 * @param {string} name A valid property name, see `DOMProperty`.
7825 * @param {*} value New value of the property.
7826 * @internal
7827 */
7828 updatePropertyByID: function (id, name, value) {
7829 var node = ReactMount.getNode(id);
7830 !!INVALID_PROPERTY_ERRORS.hasOwnProperty(name) ? "development" !== 'production' ? invariant(false, 'updatePropertyByID(...): %s', INVALID_PROPERTY_ERRORS[name]) : invariant(false) : undefined;
7831
7832 // If we're updating to null or undefined, we should remove the property
7833 // from the DOM node instead of inadvertantly setting to a string. This
7834 // brings us in line with the same behavior we have on initial render.
7835 if (value != null) {
7836 DOMPropertyOperations.setValueForProperty(node, name, value);
7837 } else {
7838 DOMPropertyOperations.deleteValueForProperty(node, name);
7839 }
7840 },
7841
7842 /**
7843 * Replaces a DOM node that exists in the document with markup.
7844 *
7845 * @param {string} id ID of child to be replaced.
7846 * @param {string} markup Dangerous markup to inject in place of child.
7847 * @internal
7848 * @see {Danger.dangerouslyReplaceNodeWithMarkup}
7849 */
7850 dangerouslyReplaceNodeWithMarkupByID: function (id, markup) {
7851 var node = ReactMount.getNode(id);
7852 DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup(node, markup);
7853 },
7854
7855 /**
7856 * Updates a component's children by processing a series of updates.
7857 *
7858 * @param {array<object>} updates List of update configurations.
7859 * @param {array<string>} markup List of markup strings.
7860 * @internal
7861 */
7862 dangerouslyProcessChildrenUpdates: function (updates, markup) {
7863 for (var i = 0; i < updates.length; i++) {
7864 updates[i].parentNode = ReactMount.getNode(updates[i].parentID);
7865 }
7866 DOMChildrenOperations.processUpdates(updates, markup);
7867 }
7868};
7869
7870ReactPerf.measureMethods(ReactDOMIDOperations, 'ReactDOMIDOperations', {
7871 dangerouslyReplaceNodeWithMarkupByID: 'dangerouslyReplaceNodeWithMarkupByID',
7872 dangerouslyProcessChildrenUpdates: 'dangerouslyProcessChildrenUpdates'
7873});
7874
7875module.exports = ReactDOMIDOperations;
7876},{"11":11,"161":161,"72":72,"78":78,"9":9}],46:[function(_dereq_,module,exports){
7877/**
7878 * Copyright 2013-2015, Facebook, Inc.
7879 * All rights reserved.
7880 *
7881 * This source code is licensed under the BSD-style license found in the
7882 * LICENSE file in the root directory of this source tree. An additional grant
7883 * of patent rights can be found in the PATENTS file in the same directory.
7884 *
7885 * @providesModule ReactDOMInput
7886 */
7887
7888'use strict';
7889
7890var ReactDOMIDOperations = _dereq_(45);
7891var LinkedValueUtils = _dereq_(23);
7892var ReactMount = _dereq_(72);
7893var ReactUpdates = _dereq_(96);
7894
7895var assign = _dereq_(24);
7896var invariant = _dereq_(161);
7897
7898var instancesByReactID = {};
7899
7900function forceUpdateIfMounted() {
7901 if (this._rootNodeID) {
7902 // DOM component is still mounted; update
7903 ReactDOMInput.updateWrapper(this);
7904 }
7905}
7906
7907/**
7908 * Implements an <input> native component that allows setting these optional
7909 * props: `checked`, `value`, `defaultChecked`, and `defaultValue`.
7910 *
7911 * If `checked` or `value` are not supplied (or null/undefined), user actions
7912 * that affect the checked state or value will trigger updates to the element.
7913 *
7914 * If they are supplied (and not null/undefined), the rendered element will not
7915 * trigger updates to the element. Instead, the props must change in order for
7916 * the rendered element to be updated.
7917 *
7918 * The rendered element will be initialized as unchecked (or `defaultChecked`)
7919 * with an empty value (or `defaultValue`).
7920 *
7921 * @see http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html
7922 */
7923var ReactDOMInput = {
7924 getNativeProps: function (inst, props, context) {
7925 var value = LinkedValueUtils.getValue(props);
7926 var checked = LinkedValueUtils.getChecked(props);
7927
7928 var nativeProps = assign({}, props, {
7929 defaultChecked: undefined,
7930 defaultValue: undefined,
7931 value: value != null ? value : inst._wrapperState.initialValue,
7932 checked: checked != null ? checked : inst._wrapperState.initialChecked,
7933 onChange: inst._wrapperState.onChange
7934 });
7935
7936 return nativeProps;
7937 },
7938
7939 mountWrapper: function (inst, props) {
7940 if ("development" !== 'production') {
7941 LinkedValueUtils.checkPropTypes('input', props, inst._currentElement._owner);
7942 }
7943
7944 var defaultValue = props.defaultValue;
7945 inst._wrapperState = {
7946 initialChecked: props.defaultChecked || false,
7947 initialValue: defaultValue != null ? defaultValue : null,
7948 onChange: _handleChange.bind(inst)
7949 };
7950 },
7951
7952 mountReadyWrapper: function (inst) {
7953 // Can't be in mountWrapper or else server rendering leaks.
7954 instancesByReactID[inst._rootNodeID] = inst;
7955 },
7956
7957 unmountWrapper: function (inst) {
7958 delete instancesByReactID[inst._rootNodeID];
7959 },
7960
7961 updateWrapper: function (inst) {
7962 var props = inst._currentElement.props;
7963
7964 // TODO: Shouldn't this be getChecked(props)?
7965 var checked = props.checked;
7966 if (checked != null) {
7967 ReactDOMIDOperations.updatePropertyByID(inst._rootNodeID, 'checked', checked || false);
7968 }
7969
7970 var value = LinkedValueUtils.getValue(props);
7971 if (value != null) {
7972 // Cast `value` to a string to ensure the value is set correctly. While
7973 // browsers typically do this as necessary, jsdom doesn't.
7974 ReactDOMIDOperations.updatePropertyByID(inst._rootNodeID, 'value', '' + value);
7975 }
7976 }
7977};
7978
7979function _handleChange(event) {
7980 var props = this._currentElement.props;
7981
7982 var returnValue = LinkedValueUtils.executeOnChange(props, event);
7983
7984 // Here we use asap to wait until all updates have propagated, which
7985 // is important when using controlled components within layers:
7986 // https://github.com/facebook/react/issues/1698
7987 ReactUpdates.asap(forceUpdateIfMounted, this);
7988
7989 var name = props.name;
7990 if (props.type === 'radio' && name != null) {
7991 var rootNode = ReactMount.getNode(this._rootNodeID);
7992 var queryRoot = rootNode;
7993
7994 while (queryRoot.parentNode) {
7995 queryRoot = queryRoot.parentNode;
7996 }
7997
7998 // If `rootNode.form` was non-null, then we could try `form.elements`,
7999 // but that sometimes behaves strangely in IE8. We could also try using
8000 // `form.getElementsByName`, but that will only return direct children
8001 // and won't include inputs that use the HTML5 `form=` attribute. Since
8002 // the input might not even be in a form, let's just use the global
8003 // `querySelectorAll` to ensure we don't miss anything.
8004 var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]');
8005
8006 for (var i = 0; i < group.length; i++) {
8007 var otherNode = group[i];
8008 if (otherNode === rootNode || otherNode.form !== rootNode.form) {
8009 continue;
8010 }
8011 // This will throw if radio buttons rendered by different copies of React
8012 // and the same name are rendered into the same form (same as #1939).
8013 // That's probably okay; we don't support it just as we don't support
8014 // mixing React with non-React.
8015 var otherID = ReactMount.getID(otherNode);
8016 !otherID ? "development" !== 'production' ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the ' + 'same `name` is not supported.') : invariant(false) : undefined;
8017 var otherInstance = instancesByReactID[otherID];
8018 !otherInstance ? "development" !== 'production' ? invariant(false, 'ReactDOMInput: Unknown radio button ID %s.', otherID) : invariant(false) : undefined;
8019 // If this is a controlled radio button group, forcing the input that
8020 // was previously checked to update will cause it to be come re-checked
8021 // as appropriate.
8022 ReactUpdates.asap(forceUpdateIfMounted, otherInstance);
8023 }
8024 }
8025
8026 return returnValue;
8027}
8028
8029module.exports = ReactDOMInput;
8030},{"161":161,"23":23,"24":24,"45":45,"72":72,"96":96}],47:[function(_dereq_,module,exports){
8031/**
8032 * Copyright 2013-2015, Facebook, Inc.
8033 * All rights reserved.
8034 *
8035 * This source code is licensed under the BSD-style license found in the
8036 * LICENSE file in the root directory of this source tree. An additional grant
8037 * of patent rights can be found in the PATENTS file in the same directory.
8038 *
8039 * @providesModule ReactDOMOption
8040 */
8041
8042'use strict';
8043
8044var ReactChildren = _dereq_(32);
8045var ReactDOMSelect = _dereq_(48);
8046
8047var assign = _dereq_(24);
8048var warning = _dereq_(173);
8049
8050var valueContextKey = ReactDOMSelect.valueContextKey;
8051
8052/**
8053 * Implements an <option> native component that warns when `selected` is set.
8054 */
8055var ReactDOMOption = {
8056 mountWrapper: function (inst, props, context) {
8057 // TODO (yungsters): Remove support for `selected` in <option>.
8058 if ("development" !== 'production') {
8059 "development" !== 'production' ? warning(props.selected == null, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.') : undefined;
8060 }
8061
8062 // Look up whether this option is 'selected' via context
8063 var selectValue = context[valueContextKey];
8064
8065 // If context key is null (e.g., no specified value or after initial mount)
8066 // or missing (e.g., for <datalist>), we don't change props.selected
8067 var selected = null;
8068 if (selectValue != null) {
8069 selected = false;
8070 if (Array.isArray(selectValue)) {
8071 // multiple
8072 for (var i = 0; i < selectValue.length; i++) {
8073 if ('' + selectValue[i] === '' + props.value) {
8074 selected = true;
8075 break;
8076 }
8077 }
8078 } else {
8079 selected = '' + selectValue === '' + props.value;
8080 }
8081 }
8082
8083 inst._wrapperState = { selected: selected };
8084 },
8085
8086 getNativeProps: function (inst, props, context) {
8087 var nativeProps = assign({ selected: undefined, children: undefined }, props);
8088
8089 // Read state only from initial mount because <select> updates value
8090 // manually; we need the initial state only for server rendering
8091 if (inst._wrapperState.selected != null) {
8092 nativeProps.selected = inst._wrapperState.selected;
8093 }
8094
8095 var content = '';
8096
8097 // Flatten children and warn if they aren't strings or numbers;
8098 // invalid types are ignored.
8099 ReactChildren.forEach(props.children, function (child) {
8100 if (child == null) {
8101 return;
8102 }
8103 if (typeof child === 'string' || typeof child === 'number') {
8104 content += child;
8105 } else {
8106 "development" !== 'production' ? warning(false, 'Only strings and numbers are supported as <option> children.') : undefined;
8107 }
8108 });
8109
8110 nativeProps.children = content;
8111 return nativeProps;
8112 }
8113
8114};
8115
8116module.exports = ReactDOMOption;
8117},{"173":173,"24":24,"32":32,"48":48}],48:[function(_dereq_,module,exports){
8118/**
8119 * Copyright 2013-2015, Facebook, Inc.
8120 * All rights reserved.
8121 *
8122 * This source code is licensed under the BSD-style license found in the
8123 * LICENSE file in the root directory of this source tree. An additional grant
8124 * of patent rights can be found in the PATENTS file in the same directory.
8125 *
8126 * @providesModule ReactDOMSelect
8127 */
8128
8129'use strict';
8130
8131var LinkedValueUtils = _dereq_(23);
8132var ReactMount = _dereq_(72);
8133var ReactUpdates = _dereq_(96);
8134
8135var assign = _dereq_(24);
8136var warning = _dereq_(173);
8137
8138var valueContextKey = '__ReactDOMSelect_value$' + Math.random().toString(36).slice(2);
8139
8140function updateOptionsIfPendingUpdateAndMounted() {
8141 if (this._rootNodeID && this._wrapperState.pendingUpdate) {
8142 this._wrapperState.pendingUpdate = false;
8143
8144 var props = this._currentElement.props;
8145 var value = LinkedValueUtils.getValue(props);
8146
8147 if (value != null) {
8148 updateOptions(this, props, value);
8149 }
8150 }
8151}
8152
8153function getDeclarationErrorAddendum(owner) {
8154 if (owner) {
8155 var name = owner.getName();
8156 if (name) {
8157 return ' Check the render method of `' + name + '`.';
8158 }
8159 }
8160 return '';
8161}
8162
8163var valuePropNames = ['value', 'defaultValue'];
8164
8165/**
8166 * Validation function for `value` and `defaultValue`.
8167 * @private
8168 */
8169function checkSelectPropTypes(inst, props) {
8170 var owner = inst._currentElement._owner;
8171 LinkedValueUtils.checkPropTypes('select', props, owner);
8172
8173 for (var i = 0; i < valuePropNames.length; i++) {
8174 var propName = valuePropNames[i];
8175 if (props[propName] == null) {
8176 continue;
8177 }
8178 if (props.multiple) {
8179 "development" !== 'production' ? warning(Array.isArray(props[propName]), 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : undefined;
8180 } else {
8181 "development" !== 'production' ? warning(!Array.isArray(props[propName]), 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : undefined;
8182 }
8183 }
8184}
8185
8186/**
8187 * @param {ReactDOMComponent} inst
8188 * @param {boolean} multiple
8189 * @param {*} propValue A stringable (with `multiple`, a list of stringables).
8190 * @private
8191 */
8192function updateOptions(inst, multiple, propValue) {
8193 var selectedValue, i;
8194 var options = ReactMount.getNode(inst._rootNodeID).options;
8195
8196 if (multiple) {
8197 selectedValue = {};
8198 for (i = 0; i < propValue.length; i++) {
8199 selectedValue['' + propValue[i]] = true;
8200 }
8201 for (i = 0; i < options.length; i++) {
8202 var selected = selectedValue.hasOwnProperty(options[i].value);
8203 if (options[i].selected !== selected) {
8204 options[i].selected = selected;
8205 }
8206 }
8207 } else {
8208 // Do not set `select.value` as exact behavior isn't consistent across all
8209 // browsers for all cases.
8210 selectedValue = '' + propValue;
8211 for (i = 0; i < options.length; i++) {
8212 if (options[i].value === selectedValue) {
8213 options[i].selected = true;
8214 return;
8215 }
8216 }
8217 if (options.length) {
8218 options[0].selected = true;
8219 }
8220 }
8221}
8222
8223/**
8224 * Implements a <select> native component that allows optionally setting the
8225 * props `value` and `defaultValue`. If `multiple` is false, the prop must be a
8226 * stringable. If `multiple` is true, the prop must be an array of stringables.
8227 *
8228 * If `value` is not supplied (or null/undefined), user actions that change the
8229 * selected option will trigger updates to the rendered options.
8230 *
8231 * If it is supplied (and not null/undefined), the rendered options will not
8232 * update in response to user actions. Instead, the `value` prop must change in
8233 * order for the rendered options to update.
8234 *
8235 * If `defaultValue` is provided, any options with the supplied values will be
8236 * selected.
8237 */
8238var ReactDOMSelect = {
8239 valueContextKey: valueContextKey,
8240
8241 getNativeProps: function (inst, props, context) {
8242 return assign({}, props, {
8243 onChange: inst._wrapperState.onChange,
8244 value: undefined
8245 });
8246 },
8247
8248 mountWrapper: function (inst, props) {
8249 if ("development" !== 'production') {
8250 checkSelectPropTypes(inst, props);
8251 }
8252
8253 var value = LinkedValueUtils.getValue(props);
8254 inst._wrapperState = {
8255 pendingUpdate: false,
8256 initialValue: value != null ? value : props.defaultValue,
8257 onChange: _handleChange.bind(inst),
8258 wasMultiple: Boolean(props.multiple)
8259 };
8260 },
8261
8262 processChildContext: function (inst, props, context) {
8263 // Pass down initial value so initial generated markup has correct
8264 // `selected` attributes
8265 var childContext = assign({}, context);
8266 childContext[valueContextKey] = inst._wrapperState.initialValue;
8267 return childContext;
8268 },
8269
8270 postUpdateWrapper: function (inst) {
8271 var props = inst._currentElement.props;
8272
8273 // After the initial mount, we control selected-ness manually so don't pass
8274 // the context value down
8275 inst._wrapperState.initialValue = undefined;
8276
8277 var wasMultiple = inst._wrapperState.wasMultiple;
8278 inst._wrapperState.wasMultiple = Boolean(props.multiple);
8279
8280 var value = LinkedValueUtils.getValue(props);
8281 if (value != null) {
8282 inst._wrapperState.pendingUpdate = false;
8283 updateOptions(inst, Boolean(props.multiple), value);
8284 } else if (wasMultiple !== Boolean(props.multiple)) {
8285 // For simplicity, reapply `defaultValue` if `multiple` is toggled.
8286 if (props.defaultValue != null) {
8287 updateOptions(inst, Boolean(props.multiple), props.defaultValue);
8288 } else {
8289 // Revert the select back to its default unselected state.
8290 updateOptions(inst, Boolean(props.multiple), props.multiple ? [] : '');
8291 }
8292 }
8293 }
8294};
8295
8296function _handleChange(event) {
8297 var props = this._currentElement.props;
8298 var returnValue = LinkedValueUtils.executeOnChange(props, event);
8299
8300 this._wrapperState.pendingUpdate = true;
8301 ReactUpdates.asap(updateOptionsIfPendingUpdateAndMounted, this);
8302 return returnValue;
8303}
8304
8305module.exports = ReactDOMSelect;
8306},{"173":173,"23":23,"24":24,"72":72,"96":96}],49:[function(_dereq_,module,exports){
8307/**
8308 * Copyright 2013-2015, Facebook, Inc.
8309 * All rights reserved.
8310 *
8311 * This source code is licensed under the BSD-style license found in the
8312 * LICENSE file in the root directory of this source tree. An additional grant
8313 * of patent rights can be found in the PATENTS file in the same directory.
8314 *
8315 * @providesModule ReactDOMSelection
8316 */
8317
8318'use strict';
8319
8320var ExecutionEnvironment = _dereq_(147);
8321
8322var getNodeForCharacterOffset = _dereq_(130);
8323var getTextContentAccessor = _dereq_(131);
8324
8325/**
8326 * While `isCollapsed` is available on the Selection object and `collapsed`
8327 * is available on the Range object, IE11 sometimes gets them wrong.
8328 * If the anchor/focus nodes and offsets are the same, the range is collapsed.
8329 */
8330function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {
8331 return anchorNode === focusNode && anchorOffset === focusOffset;
8332}
8333
8334/**
8335 * Get the appropriate anchor and focus node/offset pairs for IE.
8336 *
8337 * The catch here is that IE's selection API doesn't provide information
8338 * about whether the selection is forward or backward, so we have to
8339 * behave as though it's always forward.
8340 *
8341 * IE text differs from modern selection in that it behaves as though
8342 * block elements end with a new line. This means character offsets will
8343 * differ between the two APIs.
8344 *
8345 * @param {DOMElement} node
8346 * @return {object}
8347 */
8348function getIEOffsets(node) {
8349 var selection = document.selection;
8350 var selectedRange = selection.createRange();
8351 var selectedLength = selectedRange.text.length;
8352
8353 // Duplicate selection so we can move range without breaking user selection.
8354 var fromStart = selectedRange.duplicate();
8355 fromStart.moveToElementText(node);
8356 fromStart.setEndPoint('EndToStart', selectedRange);
8357
8358 var startOffset = fromStart.text.length;
8359 var endOffset = startOffset + selectedLength;
8360
8361 return {
8362 start: startOffset,
8363 end: endOffset
8364 };
8365}
8366
8367/**
8368 * @param {DOMElement} node
8369 * @return {?object}
8370 */
8371function getModernOffsets(node) {
8372 var selection = window.getSelection && window.getSelection();
8373
8374 if (!selection || selection.rangeCount === 0) {
8375 return null;
8376 }
8377
8378 var anchorNode = selection.anchorNode;
8379 var anchorOffset = selection.anchorOffset;
8380 var focusNode = selection.focusNode;
8381 var focusOffset = selection.focusOffset;
8382
8383 var currentRange = selection.getRangeAt(0);
8384
8385 // In Firefox, range.startContainer and range.endContainer can be "anonymous
8386 // divs", e.g. the up/down buttons on an <input type="number">. Anonymous
8387 // divs do not seem to expose properties, triggering a "Permission denied
8388 // error" if any of its properties are accessed. The only seemingly possible
8389 // way to avoid erroring is to access a property that typically works for
8390 // non-anonymous divs and catch any error that may otherwise arise. See
8391 // https://bugzilla.mozilla.org/show_bug.cgi?id=208427
8392 try {
8393 /* eslint-disable no-unused-expressions */
8394 currentRange.startContainer.nodeType;
8395 currentRange.endContainer.nodeType;
8396 /* eslint-enable no-unused-expressions */
8397 } catch (e) {
8398 return null;
8399 }
8400
8401 // If the node and offset values are the same, the selection is collapsed.
8402 // `Selection.isCollapsed` is available natively, but IE sometimes gets
8403 // this value wrong.
8404 var isSelectionCollapsed = isCollapsed(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);
8405
8406 var rangeLength = isSelectionCollapsed ? 0 : currentRange.toString().length;
8407
8408 var tempRange = currentRange.cloneRange();
8409 tempRange.selectNodeContents(node);
8410 tempRange.setEnd(currentRange.startContainer, currentRange.startOffset);
8411
8412 var isTempRangeCollapsed = isCollapsed(tempRange.startContainer, tempRange.startOffset, tempRange.endContainer, tempRange.endOffset);
8413
8414 var start = isTempRangeCollapsed ? 0 : tempRange.toString().length;
8415 var end = start + rangeLength;
8416
8417 // Detect whether the selection is backward.
8418 var detectionRange = document.createRange();
8419 detectionRange.setStart(anchorNode, anchorOffset);
8420 detectionRange.setEnd(focusNode, focusOffset);
8421 var isBackward = detectionRange.collapsed;
8422
8423 return {
8424 start: isBackward ? end : start,
8425 end: isBackward ? start : end
8426 };
8427}
8428
8429/**
8430 * @param {DOMElement|DOMTextNode} node
8431 * @param {object} offsets
8432 */
8433function setIEOffsets(node, offsets) {
8434 var range = document.selection.createRange().duplicate();
8435 var start, end;
8436
8437 if (typeof offsets.end === 'undefined') {
8438 start = offsets.start;
8439 end = start;
8440 } else if (offsets.start > offsets.end) {
8441 start = offsets.end;
8442 end = offsets.start;
8443 } else {
8444 start = offsets.start;
8445 end = offsets.end;
8446 }
8447
8448 range.moveToElementText(node);
8449 range.moveStart('character', start);
8450 range.setEndPoint('EndToStart', range);
8451 range.moveEnd('character', end - start);
8452 range.select();
8453}
8454
8455/**
8456 * In modern non-IE browsers, we can support both forward and backward
8457 * selections.
8458 *
8459 * Note: IE10+ supports the Selection object, but it does not support
8460 * the `extend` method, which means that even in modern IE, it's not possible
8461 * to programatically create a backward selection. Thus, for all IE
8462 * versions, we use the old IE API to create our selections.
8463 *
8464 * @param {DOMElement|DOMTextNode} node
8465 * @param {object} offsets
8466 */
8467function setModernOffsets(node, offsets) {
8468 if (!window.getSelection) {
8469 return;
8470 }
8471
8472 var selection = window.getSelection();
8473 var length = node[getTextContentAccessor()].length;
8474 var start = Math.min(offsets.start, length);
8475 var end = typeof offsets.end === 'undefined' ? start : Math.min(offsets.end, length);
8476
8477 // IE 11 uses modern selection, but doesn't support the extend method.
8478 // Flip backward selections, so we can set with a single range.
8479 if (!selection.extend && start > end) {
8480 var temp = end;
8481 end = start;
8482 start = temp;
8483 }
8484
8485 var startMarker = getNodeForCharacterOffset(node, start);
8486 var endMarker = getNodeForCharacterOffset(node, end);
8487
8488 if (startMarker && endMarker) {
8489 var range = document.createRange();
8490 range.setStart(startMarker.node, startMarker.offset);
8491 selection.removeAllRanges();
8492
8493 if (start > end) {
8494 selection.addRange(range);
8495 selection.extend(endMarker.node, endMarker.offset);
8496 } else {
8497 range.setEnd(endMarker.node, endMarker.offset);
8498 selection.addRange(range);
8499 }
8500 }
8501}
8502
8503var useIEOffsets = ExecutionEnvironment.canUseDOM && 'selection' in document && !('getSelection' in window);
8504
8505var ReactDOMSelection = {
8506 /**
8507 * @param {DOMElement} node
8508 */
8509 getOffsets: useIEOffsets ? getIEOffsets : getModernOffsets,
8510
8511 /**
8512 * @param {DOMElement|DOMTextNode} node
8513 * @param {object} offsets
8514 */
8515 setOffsets: useIEOffsets ? setIEOffsets : setModernOffsets
8516};
8517
8518module.exports = ReactDOMSelection;
8519},{"130":130,"131":131,"147":147}],50:[function(_dereq_,module,exports){
8520/**
8521 * Copyright 2013-2015, Facebook, Inc.
8522 * All rights reserved.
8523 *
8524 * This source code is licensed under the BSD-style license found in the
8525 * LICENSE file in the root directory of this source tree. An additional grant
8526 * of patent rights can be found in the PATENTS file in the same directory.
8527 *
8528 * @providesModule ReactDOMServer
8529 */
8530
8531'use strict';
8532
8533var ReactDefaultInjection = _dereq_(54);
8534var ReactServerRendering = _dereq_(88);
8535var ReactVersion = _dereq_(97);
8536
8537ReactDefaultInjection.inject();
8538
8539var ReactDOMServer = {
8540 renderToString: ReactServerRendering.renderToString,
8541 renderToStaticMarkup: ReactServerRendering.renderToStaticMarkup,
8542 version: ReactVersion
8543};
8544
8545module.exports = ReactDOMServer;
8546},{"54":54,"88":88,"97":97}],51:[function(_dereq_,module,exports){
8547/**
8548 * Copyright 2013-2015, Facebook, Inc.
8549 * All rights reserved.
8550 *
8551 * This source code is licensed under the BSD-style license found in the
8552 * LICENSE file in the root directory of this source tree. An additional grant
8553 * of patent rights can be found in the PATENTS file in the same directory.
8554 *
8555 * @providesModule ReactDOMTextComponent
8556 * @typechecks static-only
8557 */
8558
8559'use strict';
8560
8561var DOMChildrenOperations = _dereq_(9);
8562var DOMPropertyOperations = _dereq_(11);
8563var ReactComponentBrowserEnvironment = _dereq_(35);
8564var ReactMount = _dereq_(72);
8565
8566var assign = _dereq_(24);
8567var escapeTextContentForBrowser = _dereq_(121);
8568var setTextContent = _dereq_(139);
8569var validateDOMNesting = _dereq_(144);
8570
8571/**
8572 * Text nodes violate a couple assumptions that React makes about components:
8573 *
8574 * - When mounting text into the DOM, adjacent text nodes are merged.
8575 * - Text nodes cannot be assigned a React root ID.
8576 *
8577 * This component is used to wrap strings in elements so that they can undergo
8578 * the same reconciliation that is applied to elements.
8579 *
8580 * TODO: Investigate representing React components in the DOM with text nodes.
8581 *
8582 * @class ReactDOMTextComponent
8583 * @extends ReactComponent
8584 * @internal
8585 */
8586var ReactDOMTextComponent = function (props) {
8587 // This constructor and its argument is currently used by mocks.
8588};
8589
8590assign(ReactDOMTextComponent.prototype, {
8591
8592 /**
8593 * @param {ReactText} text
8594 * @internal
8595 */
8596 construct: function (text) {
8597 // TODO: This is really a ReactText (ReactNode), not a ReactElement
8598 this._currentElement = text;
8599 this._stringText = '' + text;
8600
8601 // Properties
8602 this._rootNodeID = null;
8603 this._mountIndex = 0;
8604 },
8605
8606 /**
8607 * Creates the markup for this text node. This node is not intended to have
8608 * any features besides containing text content.
8609 *
8610 * @param {string} rootID DOM ID of the root node.
8611 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
8612 * @return {string} Markup for this text node.
8613 * @internal
8614 */
8615 mountComponent: function (rootID, transaction, context) {
8616 if ("development" !== 'production') {
8617 if (context[validateDOMNesting.ancestorInfoContextKey]) {
8618 validateDOMNesting('span', null, context[validateDOMNesting.ancestorInfoContextKey]);
8619 }
8620 }
8621
8622 this._rootNodeID = rootID;
8623 if (transaction.useCreateElement) {
8624 var ownerDocument = context[ReactMount.ownerDocumentContextKey];
8625 var el = ownerDocument.createElement('span');
8626 DOMPropertyOperations.setAttributeForID(el, rootID);
8627 // Populate node cache
8628 ReactMount.getID(el);
8629 setTextContent(el, this._stringText);
8630 return el;
8631 } else {
8632 var escapedText = escapeTextContentForBrowser(this._stringText);
8633
8634 if (transaction.renderToStaticMarkup) {
8635 // Normally we'd wrap this in a `span` for the reasons stated above, but
8636 // since this is a situation where React won't take over (static pages),
8637 // we can simply return the text as it is.
8638 return escapedText;
8639 }
8640
8641 return '<span ' + DOMPropertyOperations.createMarkupForID(rootID) + '>' + escapedText + '</span>';
8642 }
8643 },
8644
8645 /**
8646 * Updates this component by updating the text content.
8647 *
8648 * @param {ReactText} nextText The next text content
8649 * @param {ReactReconcileTransaction} transaction
8650 * @internal
8651 */
8652 receiveComponent: function (nextText, transaction) {
8653 if (nextText !== this._currentElement) {
8654 this._currentElement = nextText;
8655 var nextStringText = '' + nextText;
8656 if (nextStringText !== this._stringText) {
8657 // TODO: Save this as pending props and use performUpdateIfNecessary
8658 // and/or updateComponent to do the actual update for consistency with
8659 // other component types?
8660 this._stringText = nextStringText;
8661 var node = ReactMount.getNode(this._rootNodeID);
8662 DOMChildrenOperations.updateTextContent(node, nextStringText);
8663 }
8664 }
8665 },
8666
8667 unmountComponent: function () {
8668 ReactComponentBrowserEnvironment.unmountIDFromEnvironment(this._rootNodeID);
8669 }
8670
8671});
8672
8673module.exports = ReactDOMTextComponent;
8674},{"11":11,"121":121,"139":139,"144":144,"24":24,"35":35,"72":72,"9":9}],52:[function(_dereq_,module,exports){
8675/**
8676 * Copyright 2013-2015, Facebook, Inc.
8677 * All rights reserved.
8678 *
8679 * This source code is licensed under the BSD-style license found in the
8680 * LICENSE file in the root directory of this source tree. An additional grant
8681 * of patent rights can be found in the PATENTS file in the same directory.
8682 *
8683 * @providesModule ReactDOMTextarea
8684 */
8685
8686'use strict';
8687
8688var LinkedValueUtils = _dereq_(23);
8689var ReactDOMIDOperations = _dereq_(45);
8690var ReactUpdates = _dereq_(96);
8691
8692var assign = _dereq_(24);
8693var invariant = _dereq_(161);
8694var warning = _dereq_(173);
8695
8696function forceUpdateIfMounted() {
8697 if (this._rootNodeID) {
8698 // DOM component is still mounted; update
8699 ReactDOMTextarea.updateWrapper(this);
8700 }
8701}
8702
8703/**
8704 * Implements a <textarea> native component that allows setting `value`, and
8705 * `defaultValue`. This differs from the traditional DOM API because value is
8706 * usually set as PCDATA children.
8707 *
8708 * If `value` is not supplied (or null/undefined), user actions that affect the
8709 * value will trigger updates to the element.
8710 *
8711 * If `value` is supplied (and not null/undefined), the rendered element will
8712 * not trigger updates to the element. Instead, the `value` prop must change in
8713 * order for the rendered element to be updated.
8714 *
8715 * The rendered element will be initialized with an empty value, the prop
8716 * `defaultValue` if specified, or the children content (deprecated).
8717 */
8718var ReactDOMTextarea = {
8719 getNativeProps: function (inst, props, context) {
8720 !(props.dangerouslySetInnerHTML == null) ? "development" !== 'production' ? invariant(false, '`dangerouslySetInnerHTML` does not make sense on <textarea>.') : invariant(false) : undefined;
8721
8722 // Always set children to the same thing. In IE9, the selection range will
8723 // get reset if `textContent` is mutated.
8724 var nativeProps = assign({}, props, {
8725 defaultValue: undefined,
8726 value: undefined,
8727 children: inst._wrapperState.initialValue,
8728 onChange: inst._wrapperState.onChange
8729 });
8730
8731 return nativeProps;
8732 },
8733
8734 mountWrapper: function (inst, props) {
8735 if ("development" !== 'production') {
8736 LinkedValueUtils.checkPropTypes('textarea', props, inst._currentElement._owner);
8737 }
8738
8739 var defaultValue = props.defaultValue;
8740 // TODO (yungsters): Remove support for children content in <textarea>.
8741 var children = props.children;
8742 if (children != null) {
8743 if ("development" !== 'production') {
8744 "development" !== 'production' ? warning(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.') : undefined;
8745 }
8746 !(defaultValue == null) ? "development" !== 'production' ? invariant(false, 'If you supply `defaultValue` on a <textarea>, do not pass children.') : invariant(false) : undefined;
8747 if (Array.isArray(children)) {
8748 !(children.length <= 1) ? "development" !== 'production' ? invariant(false, '<textarea> can only have at most one child.') : invariant(false) : undefined;
8749 children = children[0];
8750 }
8751
8752 defaultValue = '' + children;
8753 }
8754 if (defaultValue == null) {
8755 defaultValue = '';
8756 }
8757 var value = LinkedValueUtils.getValue(props);
8758
8759 inst._wrapperState = {
8760 // We save the initial value so that `ReactDOMComponent` doesn't update
8761 // `textContent` (unnecessary since we update value).
8762 // The initial value can be a boolean or object so that's why it's
8763 // forced to be a string.
8764 initialValue: '' + (value != null ? value : defaultValue),
8765 onChange: _handleChange.bind(inst)
8766 };
8767 },
8768
8769 updateWrapper: function (inst) {
8770 var props = inst._currentElement.props;
8771 var value = LinkedValueUtils.getValue(props);
8772 if (value != null) {
8773 // Cast `value` to a string to ensure the value is set correctly. While
8774 // browsers typically do this as necessary, jsdom doesn't.
8775 ReactDOMIDOperations.updatePropertyByID(inst._rootNodeID, 'value', '' + value);
8776 }
8777 }
8778};
8779
8780function _handleChange(event) {
8781 var props = this._currentElement.props;
8782 var returnValue = LinkedValueUtils.executeOnChange(props, event);
8783 ReactUpdates.asap(forceUpdateIfMounted, this);
8784 return returnValue;
8785}
8786
8787module.exports = ReactDOMTextarea;
8788},{"161":161,"173":173,"23":23,"24":24,"45":45,"96":96}],53:[function(_dereq_,module,exports){
8789/**
8790 * Copyright 2013-2015, Facebook, Inc.
8791 * All rights reserved.
8792 *
8793 * This source code is licensed under the BSD-style license found in the
8794 * LICENSE file in the root directory of this source tree. An additional grant
8795 * of patent rights can be found in the PATENTS file in the same directory.
8796 *
8797 * @providesModule ReactDefaultBatchingStrategy
8798 */
8799
8800'use strict';
8801
8802var ReactUpdates = _dereq_(96);
8803var Transaction = _dereq_(113);
8804
8805var assign = _dereq_(24);
8806var emptyFunction = _dereq_(153);
8807
8808var RESET_BATCHED_UPDATES = {
8809 initialize: emptyFunction,
8810 close: function () {
8811 ReactDefaultBatchingStrategy.isBatchingUpdates = false;
8812 }
8813};
8814
8815var FLUSH_BATCHED_UPDATES = {
8816 initialize: emptyFunction,
8817 close: ReactUpdates.flushBatchedUpdates.bind(ReactUpdates)
8818};
8819
8820var TRANSACTION_WRAPPERS = [FLUSH_BATCHED_UPDATES, RESET_BATCHED_UPDATES];
8821
8822function ReactDefaultBatchingStrategyTransaction() {
8823 this.reinitializeTransaction();
8824}
8825
8826assign(ReactDefaultBatchingStrategyTransaction.prototype, Transaction.Mixin, {
8827 getTransactionWrappers: function () {
8828 return TRANSACTION_WRAPPERS;
8829 }
8830});
8831
8832var transaction = new ReactDefaultBatchingStrategyTransaction();
8833
8834var ReactDefaultBatchingStrategy = {
8835 isBatchingUpdates: false,
8836
8837 /**
8838 * Call the provided function in a context within which calls to `setState`
8839 * and friends are batched such that components aren't updated unnecessarily.
8840 */
8841 batchedUpdates: function (callback, a, b, c, d, e) {
8842 var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates;
8843
8844 ReactDefaultBatchingStrategy.isBatchingUpdates = true;
8845
8846 // The code is written this way to avoid extra allocations
8847 if (alreadyBatchingUpdates) {
8848 callback(a, b, c, d, e);
8849 } else {
8850 transaction.perform(callback, null, a, b, c, d, e);
8851 }
8852 }
8853};
8854
8855module.exports = ReactDefaultBatchingStrategy;
8856},{"113":113,"153":153,"24":24,"96":96}],54:[function(_dereq_,module,exports){
8857/**
8858 * Copyright 2013-2015, Facebook, Inc.
8859 * All rights reserved.
8860 *
8861 * This source code is licensed under the BSD-style license found in the
8862 * LICENSE file in the root directory of this source tree. An additional grant
8863 * of patent rights can be found in the PATENTS file in the same directory.
8864 *
8865 * @providesModule ReactDefaultInjection
8866 */
8867
8868'use strict';
8869
8870var BeforeInputEventPlugin = _dereq_(3);
8871var ChangeEventPlugin = _dereq_(7);
8872var ClientReactRootIndex = _dereq_(8);
8873var DefaultEventPluginOrder = _dereq_(13);
8874var EnterLeaveEventPlugin = _dereq_(14);
8875var ExecutionEnvironment = _dereq_(147);
8876var HTMLDOMPropertyConfig = _dereq_(21);
8877var ReactBrowserComponentMixin = _dereq_(27);
8878var ReactComponentBrowserEnvironment = _dereq_(35);
8879var ReactDefaultBatchingStrategy = _dereq_(53);
8880var ReactDOMComponent = _dereq_(42);
8881var ReactDOMTextComponent = _dereq_(51);
8882var ReactEventListener = _dereq_(63);
8883var ReactInjection = _dereq_(65);
8884var ReactInstanceHandles = _dereq_(67);
8885var ReactMount = _dereq_(72);
8886var ReactReconcileTransaction = _dereq_(83);
8887var SelectEventPlugin = _dereq_(99);
8888var ServerReactRootIndex = _dereq_(100);
8889var SimpleEventPlugin = _dereq_(101);
8890var SVGDOMPropertyConfig = _dereq_(98);
8891
8892var alreadyInjected = false;
8893
8894function inject() {
8895 if (alreadyInjected) {
8896 // TODO: This is currently true because these injections are shared between
8897 // the client and the server package. They should be built independently
8898 // and not share any injection state. Then this problem will be solved.
8899 return;
8900 }
8901 alreadyInjected = true;
8902
8903 ReactInjection.EventEmitter.injectReactEventListener(ReactEventListener);
8904
8905 /**
8906 * Inject modules for resolving DOM hierarchy and plugin ordering.
8907 */
8908 ReactInjection.EventPluginHub.injectEventPluginOrder(DefaultEventPluginOrder);
8909 ReactInjection.EventPluginHub.injectInstanceHandle(ReactInstanceHandles);
8910 ReactInjection.EventPluginHub.injectMount(ReactMount);
8911
8912 /**
8913 * Some important event plugins included by default (without having to require
8914 * them).
8915 */
8916 ReactInjection.EventPluginHub.injectEventPluginsByName({
8917 SimpleEventPlugin: SimpleEventPlugin,
8918 EnterLeaveEventPlugin: EnterLeaveEventPlugin,
8919 ChangeEventPlugin: ChangeEventPlugin,
8920 SelectEventPlugin: SelectEventPlugin,
8921 BeforeInputEventPlugin: BeforeInputEventPlugin
8922 });
8923
8924 ReactInjection.NativeComponent.injectGenericComponentClass(ReactDOMComponent);
8925
8926 ReactInjection.NativeComponent.injectTextComponentClass(ReactDOMTextComponent);
8927
8928 ReactInjection.Class.injectMixin(ReactBrowserComponentMixin);
8929
8930 ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig);
8931 ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfig);
8932
8933 ReactInjection.EmptyComponent.injectEmptyComponent('noscript');
8934
8935 ReactInjection.Updates.injectReconcileTransaction(ReactReconcileTransaction);
8936 ReactInjection.Updates.injectBatchingStrategy(ReactDefaultBatchingStrategy);
8937
8938 ReactInjection.RootIndex.injectCreateReactRootIndex(ExecutionEnvironment.canUseDOM ? ClientReactRootIndex.createReactRootIndex : ServerReactRootIndex.createReactRootIndex);
8939
8940 ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment);
8941
8942 if ("development" !== 'production') {
8943 var url = ExecutionEnvironment.canUseDOM && window.location.href || '';
8944 if (/[?&]react_perf\b/.test(url)) {
8945 var ReactDefaultPerf = _dereq_(55);
8946 ReactDefaultPerf.start();
8947 }
8948 }
8949}
8950
8951module.exports = {
8952 inject: inject
8953};
8954},{"100":100,"101":101,"13":13,"14":14,"147":147,"21":21,"27":27,"3":3,"35":35,"42":42,"51":51,"53":53,"55":55,"63":63,"65":65,"67":67,"7":7,"72":72,"8":8,"83":83,"98":98,"99":99}],55:[function(_dereq_,module,exports){
8955/**
8956 * Copyright 2013-2015, Facebook, Inc.
8957 * All rights reserved.
8958 *
8959 * This source code is licensed under the BSD-style license found in the
8960 * LICENSE file in the root directory of this source tree. An additional grant
8961 * of patent rights can be found in the PATENTS file in the same directory.
8962 *
8963 * @providesModule ReactDefaultPerf
8964 * @typechecks static-only
8965 */
8966
8967'use strict';
8968
8969var DOMProperty = _dereq_(10);
8970var ReactDefaultPerfAnalysis = _dereq_(56);
8971var ReactMount = _dereq_(72);
8972var ReactPerf = _dereq_(78);
8973
8974var performanceNow = _dereq_(170);
8975
8976function roundFloat(val) {
8977 return Math.floor(val * 100) / 100;
8978}
8979
8980function addValue(obj, key, val) {
8981 obj[key] = (obj[key] || 0) + val;
8982}
8983
8984var ReactDefaultPerf = {
8985 _allMeasurements: [], // last item in the list is the current one
8986 _mountStack: [0],
8987 _injected: false,
8988
8989 start: function () {
8990 if (!ReactDefaultPerf._injected) {
8991 ReactPerf.injection.injectMeasure(ReactDefaultPerf.measure);
8992 }
8993
8994 ReactDefaultPerf._allMeasurements.length = 0;
8995 ReactPerf.enableMeasure = true;
8996 },
8997
8998 stop: function () {
8999 ReactPerf.enableMeasure = false;
9000 },
9001
9002 getLastMeasurements: function () {
9003 return ReactDefaultPerf._allMeasurements;
9004 },
9005
9006 printExclusive: function (measurements) {
9007 measurements = measurements || ReactDefaultPerf._allMeasurements;
9008 var summary = ReactDefaultPerfAnalysis.getExclusiveSummary(measurements);
9009 console.table(summary.map(function (item) {
9010 return {
9011 'Component class name': item.componentName,
9012 'Total inclusive time (ms)': roundFloat(item.inclusive),
9013 'Exclusive mount time (ms)': roundFloat(item.exclusive),
9014 'Exclusive render time (ms)': roundFloat(item.render),
9015 'Mount time per instance (ms)': roundFloat(item.exclusive / item.count),
9016 'Render time per instance (ms)': roundFloat(item.render / item.count),
9017 'Instances': item.count
9018 };
9019 }));
9020 // TODO: ReactDefaultPerfAnalysis.getTotalTime() does not return the correct
9021 // number.
9022 },
9023
9024 printInclusive: function (measurements) {
9025 measurements = measurements || ReactDefaultPerf._allMeasurements;
9026 var summary = ReactDefaultPerfAnalysis.getInclusiveSummary(measurements);
9027 console.table(summary.map(function (item) {
9028 return {
9029 'Owner > component': item.componentName,
9030 'Inclusive time (ms)': roundFloat(item.time),
9031 'Instances': item.count
9032 };
9033 }));
9034 console.log('Total time:', ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2) + ' ms');
9035 },
9036
9037 getMeasurementsSummaryMap: function (measurements) {
9038 var summary = ReactDefaultPerfAnalysis.getInclusiveSummary(measurements, true);
9039 return summary.map(function (item) {
9040 return {
9041 'Owner > component': item.componentName,
9042 'Wasted time (ms)': item.time,
9043 'Instances': item.count
9044 };
9045 });
9046 },
9047
9048 printWasted: function (measurements) {
9049 measurements = measurements || ReactDefaultPerf._allMeasurements;
9050 console.table(ReactDefaultPerf.getMeasurementsSummaryMap(measurements));
9051 console.log('Total time:', ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2) + ' ms');
9052 },
9053
9054 printDOM: function (measurements) {
9055 measurements = measurements || ReactDefaultPerf._allMeasurements;
9056 var summary = ReactDefaultPerfAnalysis.getDOMSummary(measurements);
9057 console.table(summary.map(function (item) {
9058 var result = {};
9059 result[DOMProperty.ID_ATTRIBUTE_NAME] = item.id;
9060 result.type = item.type;
9061 result.args = JSON.stringify(item.args);
9062 return result;
9063 }));
9064 console.log('Total time:', ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2) + ' ms');
9065 },
9066
9067 _recordWrite: function (id, fnName, totalTime, args) {
9068 // TODO: totalTime isn't that useful since it doesn't count paints/reflows
9069 var writes = ReactDefaultPerf._allMeasurements[ReactDefaultPerf._allMeasurements.length - 1].writes;
9070 writes[id] = writes[id] || [];
9071 writes[id].push({
9072 type: fnName,
9073 time: totalTime,
9074 args: args
9075 });
9076 },
9077
9078 measure: function (moduleName, fnName, func) {
9079 return function () {
9080 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
9081 args[_key] = arguments[_key];
9082 }
9083
9084 var totalTime;
9085 var rv;
9086 var start;
9087
9088 if (fnName === '_renderNewRootComponent' || fnName === 'flushBatchedUpdates') {
9089 // A "measurement" is a set of metrics recorded for each flush. We want
9090 // to group the metrics for a given flush together so we can look at the
9091 // components that rendered and the DOM operations that actually
9092 // happened to determine the amount of "wasted work" performed.
9093 ReactDefaultPerf._allMeasurements.push({
9094 exclusive: {},
9095 inclusive: {},
9096 render: {},
9097 counts: {},
9098 writes: {},
9099 displayNames: {},
9100 totalTime: 0,
9101 created: {}
9102 });
9103 start = performanceNow();
9104 rv = func.apply(this, args);
9105 ReactDefaultPerf._allMeasurements[ReactDefaultPerf._allMeasurements.length - 1].totalTime = performanceNow() - start;
9106 return rv;
9107 } else if (fnName === '_mountImageIntoNode' || moduleName === 'ReactBrowserEventEmitter' || moduleName === 'ReactDOMIDOperations' || moduleName === 'CSSPropertyOperations' || moduleName === 'DOMChildrenOperations' || moduleName === 'DOMPropertyOperations') {
9108 start = performanceNow();
9109 rv = func.apply(this, args);
9110 totalTime = performanceNow() - start;
9111
9112 if (fnName === '_mountImageIntoNode') {
9113 var mountID = ReactMount.getID(args[1]);
9114 ReactDefaultPerf._recordWrite(mountID, fnName, totalTime, args[0]);
9115 } else if (fnName === 'dangerouslyProcessChildrenUpdates') {
9116 // special format
9117 args[0].forEach(function (update) {
9118 var writeArgs = {};
9119 if (update.fromIndex !== null) {
9120 writeArgs.fromIndex = update.fromIndex;
9121 }
9122 if (update.toIndex !== null) {
9123 writeArgs.toIndex = update.toIndex;
9124 }
9125 if (update.textContent !== null) {
9126 writeArgs.textContent = update.textContent;
9127 }
9128 if (update.markupIndex !== null) {
9129 writeArgs.markup = args[1][update.markupIndex];
9130 }
9131 ReactDefaultPerf._recordWrite(update.parentID, update.type, totalTime, writeArgs);
9132 });
9133 } else {
9134 // basic format
9135 var id = args[0];
9136 if (typeof id === 'object') {
9137 id = ReactMount.getID(args[0]);
9138 }
9139 ReactDefaultPerf._recordWrite(id, fnName, totalTime, Array.prototype.slice.call(args, 1));
9140 }
9141 return rv;
9142 } else if (moduleName === 'ReactCompositeComponent' && (fnName === 'mountComponent' || fnName === 'updateComponent' || // TODO: receiveComponent()?
9143 fnName === '_renderValidatedComponent')) {
9144
9145 if (this._currentElement.type === ReactMount.TopLevelWrapper) {
9146 return func.apply(this, args);
9147 }
9148
9149 var rootNodeID = fnName === 'mountComponent' ? args[0] : this._rootNodeID;
9150 var isRender = fnName === '_renderValidatedComponent';
9151 var isMount = fnName === 'mountComponent';
9152
9153 var mountStack = ReactDefaultPerf._mountStack;
9154 var entry = ReactDefaultPerf._allMeasurements[ReactDefaultPerf._allMeasurements.length - 1];
9155
9156 if (isRender) {
9157 addValue(entry.counts, rootNodeID, 1);
9158 } else if (isMount) {
9159 entry.created[rootNodeID] = true;
9160 mountStack.push(0);
9161 }
9162
9163 start = performanceNow();
9164 rv = func.apply(this, args);
9165 totalTime = performanceNow() - start;
9166
9167 if (isRender) {
9168 addValue(entry.render, rootNodeID, totalTime);
9169 } else if (isMount) {
9170 var subMountTime = mountStack.pop();
9171 mountStack[mountStack.length - 1] += totalTime;
9172 addValue(entry.exclusive, rootNodeID, totalTime - subMountTime);
9173 addValue(entry.inclusive, rootNodeID, totalTime);
9174 } else {
9175 addValue(entry.inclusive, rootNodeID, totalTime);
9176 }
9177
9178 entry.displayNames[rootNodeID] = {
9179 current: this.getName(),
9180 owner: this._currentElement._owner ? this._currentElement._owner.getName() : '<root>'
9181 };
9182
9183 return rv;
9184 } else {
9185 return func.apply(this, args);
9186 }
9187 };
9188 }
9189};
9190
9191module.exports = ReactDefaultPerf;
9192},{"10":10,"170":170,"56":56,"72":72,"78":78}],56:[function(_dereq_,module,exports){
9193/**
9194 * Copyright 2013-2015, Facebook, Inc.
9195 * All rights reserved.
9196 *
9197 * This source code is licensed under the BSD-style license found in the
9198 * LICENSE file in the root directory of this source tree. An additional grant
9199 * of patent rights can be found in the PATENTS file in the same directory.
9200 *
9201 * @providesModule ReactDefaultPerfAnalysis
9202 */
9203
9204'use strict';
9205
9206var assign = _dereq_(24);
9207
9208// Don't try to save users less than 1.2ms (a number I made up)
9209var DONT_CARE_THRESHOLD = 1.2;
9210var DOM_OPERATION_TYPES = {
9211 '_mountImageIntoNode': 'set innerHTML',
9212 INSERT_MARKUP: 'set innerHTML',
9213 MOVE_EXISTING: 'move',
9214 REMOVE_NODE: 'remove',
9215 SET_MARKUP: 'set innerHTML',
9216 TEXT_CONTENT: 'set textContent',
9217 'setValueForProperty': 'update attribute',
9218 'setValueForAttribute': 'update attribute',
9219 'deleteValueForProperty': 'remove attribute',
9220 'dangerouslyReplaceNodeWithMarkupByID': 'replace'
9221};
9222
9223function getTotalTime(measurements) {
9224 // TODO: return number of DOM ops? could be misleading.
9225 // TODO: measure dropped frames after reconcile?
9226 // TODO: log total time of each reconcile and the top-level component
9227 // class that triggered it.
9228 var totalTime = 0;
9229 for (var i = 0; i < measurements.length; i++) {
9230 var measurement = measurements[i];
9231 totalTime += measurement.totalTime;
9232 }
9233 return totalTime;
9234}
9235
9236function getDOMSummary(measurements) {
9237 var items = [];
9238 measurements.forEach(function (measurement) {
9239 Object.keys(measurement.writes).forEach(function (id) {
9240 measurement.writes[id].forEach(function (write) {
9241 items.push({
9242 id: id,
9243 type: DOM_OPERATION_TYPES[write.type] || write.type,
9244 args: write.args
9245 });
9246 });
9247 });
9248 });
9249 return items;
9250}
9251
9252function getExclusiveSummary(measurements) {
9253 var candidates = {};
9254 var displayName;
9255
9256 for (var i = 0; i < measurements.length; i++) {
9257 var measurement = measurements[i];
9258 var allIDs = assign({}, measurement.exclusive, measurement.inclusive);
9259
9260 for (var id in allIDs) {
9261 displayName = measurement.displayNames[id].current;
9262
9263 candidates[displayName] = candidates[displayName] || {
9264 componentName: displayName,
9265 inclusive: 0,
9266 exclusive: 0,
9267 render: 0,
9268 count: 0
9269 };
9270 if (measurement.render[id]) {
9271 candidates[displayName].render += measurement.render[id];
9272 }
9273 if (measurement.exclusive[id]) {
9274 candidates[displayName].exclusive += measurement.exclusive[id];
9275 }
9276 if (measurement.inclusive[id]) {
9277 candidates[displayName].inclusive += measurement.inclusive[id];
9278 }
9279 if (measurement.counts[id]) {
9280 candidates[displayName].count += measurement.counts[id];
9281 }
9282 }
9283 }
9284
9285 // Now make a sorted array with the results.
9286 var arr = [];
9287 for (displayName in candidates) {
9288 if (candidates[displayName].exclusive >= DONT_CARE_THRESHOLD) {
9289 arr.push(candidates[displayName]);
9290 }
9291 }
9292
9293 arr.sort(function (a, b) {
9294 return b.exclusive - a.exclusive;
9295 });
9296
9297 return arr;
9298}
9299
9300function getInclusiveSummary(measurements, onlyClean) {
9301 var candidates = {};
9302 var inclusiveKey;
9303
9304 for (var i = 0; i < measurements.length; i++) {
9305 var measurement = measurements[i];
9306 var allIDs = assign({}, measurement.exclusive, measurement.inclusive);
9307 var cleanComponents;
9308
9309 if (onlyClean) {
9310 cleanComponents = getUnchangedComponents(measurement);
9311 }
9312
9313 for (var id in allIDs) {
9314 if (onlyClean && !cleanComponents[id]) {
9315 continue;
9316 }
9317
9318 var displayName = measurement.displayNames[id];
9319
9320 // Inclusive time is not useful for many components without knowing where
9321 // they are instantiated. So we aggregate inclusive time with both the
9322 // owner and current displayName as the key.
9323 inclusiveKey = displayName.owner + ' > ' + displayName.current;
9324
9325 candidates[inclusiveKey] = candidates[inclusiveKey] || {
9326 componentName: inclusiveKey,
9327 time: 0,
9328 count: 0
9329 };
9330
9331 if (measurement.inclusive[id]) {
9332 candidates[inclusiveKey].time += measurement.inclusive[id];
9333 }
9334 if (measurement.counts[id]) {
9335 candidates[inclusiveKey].count += measurement.counts[id];
9336 }
9337 }
9338 }
9339
9340 // Now make a sorted array with the results.
9341 var arr = [];
9342 for (inclusiveKey in candidates) {
9343 if (candidates[inclusiveKey].time >= DONT_CARE_THRESHOLD) {
9344 arr.push(candidates[inclusiveKey]);
9345 }
9346 }
9347
9348 arr.sort(function (a, b) {
9349 return b.time - a.time;
9350 });
9351
9352 return arr;
9353}
9354
9355function getUnchangedComponents(measurement) {
9356 // For a given reconcile, look at which components did not actually
9357 // render anything to the DOM and return a mapping of their ID to
9358 // the amount of time it took to render the entire subtree.
9359 var cleanComponents = {};
9360 var dirtyLeafIDs = Object.keys(measurement.writes);
9361 var allIDs = assign({}, measurement.exclusive, measurement.inclusive);
9362
9363 for (var id in allIDs) {
9364 var isDirty = false;
9365 // For each component that rendered, see if a component that triggered
9366 // a DOM op is in its subtree.
9367 for (var i = 0; i < dirtyLeafIDs.length; i++) {
9368 if (dirtyLeafIDs[i].indexOf(id) === 0) {
9369 isDirty = true;
9370 break;
9371 }
9372 }
9373 // check if component newly created
9374 if (measurement.created[id]) {
9375 isDirty = true;
9376 }
9377 if (!isDirty && measurement.counts[id] > 0) {
9378 cleanComponents[id] = true;
9379 }
9380 }
9381 return cleanComponents;
9382}
9383
9384var ReactDefaultPerfAnalysis = {
9385 getExclusiveSummary: getExclusiveSummary,
9386 getInclusiveSummary: getInclusiveSummary,
9387 getDOMSummary: getDOMSummary,
9388 getTotalTime: getTotalTime
9389};
9390
9391module.exports = ReactDefaultPerfAnalysis;
9392},{"24":24}],57:[function(_dereq_,module,exports){
9393/**
9394 * Copyright 2014-2015, Facebook, Inc.
9395 * All rights reserved.
9396 *
9397 * This source code is licensed under the BSD-style license found in the
9398 * LICENSE file in the root directory of this source tree. An additional grant
9399 * of patent rights can be found in the PATENTS file in the same directory.
9400 *
9401 * @providesModule ReactElement
9402 */
9403
9404'use strict';
9405
9406var ReactCurrentOwner = _dereq_(39);
9407
9408var assign = _dereq_(24);
9409var canDefineProperty = _dereq_(117);
9410
9411// The Symbol used to tag the ReactElement type. If there is no native Symbol
9412// nor polyfill, then a plain number is used for performance.
9413var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
9414
9415var RESERVED_PROPS = {
9416 key: true,
9417 ref: true,
9418 __self: true,
9419 __source: true
9420};
9421
9422/**
9423 * Base constructor for all React elements. This is only used to make this
9424 * work with a dynamic instanceof check. Nothing should live on this prototype.
9425 *
9426 * @param {*} type
9427 * @param {*} key
9428 * @param {string|object} ref
9429 * @param {*} self A *temporary* helper to detect places where `this` is
9430 * different from the `owner` when React.createElement is called, so that we
9431 * can warn. We want to get rid of owner and replace string `ref`s with arrow
9432 * functions, and as long as `this` and owner are the same, there will be no
9433 * change in behavior.
9434 * @param {*} source An annotation object (added by a transpiler or otherwise)
9435 * indicating filename, line number, and/or other information.
9436 * @param {*} owner
9437 * @param {*} props
9438 * @internal
9439 */
9440var ReactElement = function (type, key, ref, self, source, owner, props) {
9441 var element = {
9442 // This tag allow us to uniquely identify this as a React Element
9443 $$typeof: REACT_ELEMENT_TYPE,
9444
9445 // Built-in properties that belong on the element
9446 type: type,
9447 key: key,
9448 ref: ref,
9449 props: props,
9450
9451 // Record the component responsible for creating this element.
9452 _owner: owner
9453 };
9454
9455 if ("development" !== 'production') {
9456 // The validation flag is currently mutative. We put it on
9457 // an external backing store so that we can freeze the whole object.
9458 // This can be replaced with a WeakMap once they are implemented in
9459 // commonly used development environments.
9460 element._store = {};
9461
9462 // To make comparing ReactElements easier for testing purposes, we make
9463 // the validation flag non-enumerable (where possible, which should
9464 // include every environment we run tests in), so the test framework
9465 // ignores it.
9466 if (canDefineProperty) {
9467 Object.defineProperty(element._store, 'validated', {
9468 configurable: false,
9469 enumerable: false,
9470 writable: true,
9471 value: false
9472 });
9473 // self and source are DEV only properties.
9474 Object.defineProperty(element, '_self', {
9475 configurable: false,
9476 enumerable: false,
9477 writable: false,
9478 value: self
9479 });
9480 // Two elements created in two different places should be considered
9481 // equal for testing purposes and therefore we hide it from enumeration.
9482 Object.defineProperty(element, '_source', {
9483 configurable: false,
9484 enumerable: false,
9485 writable: false,
9486 value: source
9487 });
9488 } else {
9489 element._store.validated = false;
9490 element._self = self;
9491 element._source = source;
9492 }
9493 Object.freeze(element.props);
9494 Object.freeze(element);
9495 }
9496
9497 return element;
9498};
9499
9500ReactElement.createElement = function (type, config, children) {
9501 var propName;
9502
9503 // Reserved names are extracted
9504 var props = {};
9505
9506 var key = null;
9507 var ref = null;
9508 var self = null;
9509 var source = null;
9510
9511 if (config != null) {
9512 ref = config.ref === undefined ? null : config.ref;
9513 key = config.key === undefined ? null : '' + config.key;
9514 self = config.__self === undefined ? null : config.__self;
9515 source = config.__source === undefined ? null : config.__source;
9516 // Remaining properties are added to a new props object
9517 for (propName in config) {
9518 if (config.hasOwnProperty(propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
9519 props[propName] = config[propName];
9520 }
9521 }
9522 }
9523
9524 // Children can be more than one argument, and those are transferred onto
9525 // the newly allocated props object.
9526 var childrenLength = arguments.length - 2;
9527 if (childrenLength === 1) {
9528 props.children = children;
9529 } else if (childrenLength > 1) {
9530 var childArray = Array(childrenLength);
9531 for (var i = 0; i < childrenLength; i++) {
9532 childArray[i] = arguments[i + 2];
9533 }
9534 props.children = childArray;
9535 }
9536
9537 // Resolve default props
9538 if (type && type.defaultProps) {
9539 var defaultProps = type.defaultProps;
9540 for (propName in defaultProps) {
9541 if (typeof props[propName] === 'undefined') {
9542 props[propName] = defaultProps[propName];
9543 }
9544 }
9545 }
9546
9547 return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
9548};
9549
9550ReactElement.createFactory = function (type) {
9551 var factory = ReactElement.createElement.bind(null, type);
9552 // Expose the type on the factory and the prototype so that it can be
9553 // easily accessed on elements. E.g. `<Foo />.type === Foo`.
9554 // This should not be named `constructor` since this may not be the function
9555 // that created the element, and it may not even be a constructor.
9556 // Legacy hook TODO: Warn if this is accessed
9557 factory.type = type;
9558 return factory;
9559};
9560
9561ReactElement.cloneAndReplaceKey = function (oldElement, newKey) {
9562 var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
9563
9564 return newElement;
9565};
9566
9567ReactElement.cloneAndReplaceProps = function (oldElement, newProps) {
9568 var newElement = ReactElement(oldElement.type, oldElement.key, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, newProps);
9569
9570 if ("development" !== 'production') {
9571 // If the key on the original is valid, then the clone is valid
9572 newElement._store.validated = oldElement._store.validated;
9573 }
9574
9575 return newElement;
9576};
9577
9578ReactElement.cloneElement = function (element, config, children) {
9579 var propName;
9580
9581 // Original props are copied
9582 var props = assign({}, element.props);
9583
9584 // Reserved names are extracted
9585 var key = element.key;
9586 var ref = element.ref;
9587 // Self is preserved since the owner is preserved.
9588 var self = element._self;
9589 // Source is preserved since cloneElement is unlikely to be targeted by a
9590 // transpiler, and the original source is probably a better indicator of the
9591 // true owner.
9592 var source = element._source;
9593
9594 // Owner will be preserved, unless ref is overridden
9595 var owner = element._owner;
9596
9597 if (config != null) {
9598 if (config.ref !== undefined) {
9599 // Silently steal the ref from the parent.
9600 ref = config.ref;
9601 owner = ReactCurrentOwner.current;
9602 }
9603 if (config.key !== undefined) {
9604 key = '' + config.key;
9605 }
9606 // Remaining properties override existing props
9607 for (propName in config) {
9608 if (config.hasOwnProperty(propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
9609 props[propName] = config[propName];
9610 }
9611 }
9612 }
9613
9614 // Children can be more than one argument, and those are transferred onto
9615 // the newly allocated props object.
9616 var childrenLength = arguments.length - 2;
9617 if (childrenLength === 1) {
9618 props.children = children;
9619 } else if (childrenLength > 1) {
9620 var childArray = Array(childrenLength);
9621 for (var i = 0; i < childrenLength; i++) {
9622 childArray[i] = arguments[i + 2];
9623 }
9624 props.children = childArray;
9625 }
9626
9627 return ReactElement(element.type, key, ref, self, source, owner, props);
9628};
9629
9630/**
9631 * @param {?object} object
9632 * @return {boolean} True if `object` is a valid component.
9633 * @final
9634 */
9635ReactElement.isValidElement = function (object) {
9636 return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
9637};
9638
9639module.exports = ReactElement;
9640},{"117":117,"24":24,"39":39}],58:[function(_dereq_,module,exports){
9641/**
9642 * Copyright 2014-2015, Facebook, Inc.
9643 * All rights reserved.
9644 *
9645 * This source code is licensed under the BSD-style license found in the
9646 * LICENSE file in the root directory of this source tree. An additional grant
9647 * of patent rights can be found in the PATENTS file in the same directory.
9648 *
9649 * @providesModule ReactElementValidator
9650 */
9651
9652/**
9653 * ReactElementValidator provides a wrapper around a element factory
9654 * which validates the props passed to the element. This is intended to be
9655 * used only in DEV and could be replaced by a static type checker for languages
9656 * that support it.
9657 */
9658
9659'use strict';
9660
9661var ReactElement = _dereq_(57);
9662var ReactPropTypeLocations = _dereq_(81);
9663var ReactPropTypeLocationNames = _dereq_(80);
9664var ReactCurrentOwner = _dereq_(39);
9665
9666var canDefineProperty = _dereq_(117);
9667var getIteratorFn = _dereq_(129);
9668var invariant = _dereq_(161);
9669var warning = _dereq_(173);
9670
9671function getDeclarationErrorAddendum() {
9672 if (ReactCurrentOwner.current) {
9673 var name = ReactCurrentOwner.current.getName();
9674 if (name) {
9675 return ' Check the render method of `' + name + '`.';
9676 }
9677 }
9678 return '';
9679}
9680
9681/**
9682 * Warn if there's no key explicitly set on dynamic arrays of children or
9683 * object keys are not valid. This allows us to keep track of children between
9684 * updates.
9685 */
9686var ownerHasKeyUseWarning = {};
9687
9688var loggedTypeFailures = {};
9689
9690/**
9691 * Warn if the element doesn't have an explicit key assigned to it.
9692 * This element is in an array. The array could grow and shrink or be
9693 * reordered. All children that haven't already been validated are required to
9694 * have a "key" property assigned to it.
9695 *
9696 * @internal
9697 * @param {ReactElement} element Element that requires a key.
9698 * @param {*} parentType element's parent's type.
9699 */
9700function validateExplicitKey(element, parentType) {
9701 if (!element._store || element._store.validated || element.key != null) {
9702 return;
9703 }
9704 element._store.validated = true;
9705
9706 var addenda = getAddendaForKeyUse('uniqueKey', element, parentType);
9707 if (addenda === null) {
9708 // we already showed the warning
9709 return;
9710 }
9711 "development" !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s%s', addenda.parentOrOwner || '', addenda.childOwner || '', addenda.url || '') : undefined;
9712}
9713
9714/**
9715 * Shared warning and monitoring code for the key warnings.
9716 *
9717 * @internal
9718 * @param {string} messageType A key used for de-duping warnings.
9719 * @param {ReactElement} element Component that requires a key.
9720 * @param {*} parentType element's parent's type.
9721 * @returns {?object} A set of addenda to use in the warning message, or null
9722 * if the warning has already been shown before (and shouldn't be shown again).
9723 */
9724function getAddendaForKeyUse(messageType, element, parentType) {
9725 var addendum = getDeclarationErrorAddendum();
9726 if (!addendum) {
9727 var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
9728 if (parentName) {
9729 addendum = ' Check the top-level render call using <' + parentName + '>.';
9730 }
9731 }
9732
9733 var memoizer = ownerHasKeyUseWarning[messageType] || (ownerHasKeyUseWarning[messageType] = {});
9734 if (memoizer[addendum]) {
9735 return null;
9736 }
9737 memoizer[addendum] = true;
9738
9739 var addenda = {
9740 parentOrOwner: addendum,
9741 url: ' See https://fb.me/react-warning-keys for more information.',
9742 childOwner: null
9743 };
9744
9745 // Usually the current owner is the offender, but if it accepts children as a
9746 // property, it may be the creator of the child that's responsible for
9747 // assigning it a key.
9748 if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
9749 // Give the component that originally created this child.
9750 addenda.childOwner = ' It was passed a child from ' + element._owner.getName() + '.';
9751 }
9752
9753 return addenda;
9754}
9755
9756/**
9757 * Ensure that every element either is passed in a static location, in an
9758 * array with an explicit keys property defined, or in an object literal
9759 * with valid key property.
9760 *
9761 * @internal
9762 * @param {ReactNode} node Statically passed child of any type.
9763 * @param {*} parentType node's parent's type.
9764 */
9765function validateChildKeys(node, parentType) {
9766 if (typeof node !== 'object') {
9767 return;
9768 }
9769 if (Array.isArray(node)) {
9770 for (var i = 0; i < node.length; i++) {
9771 var child = node[i];
9772 if (ReactElement.isValidElement(child)) {
9773 validateExplicitKey(child, parentType);
9774 }
9775 }
9776 } else if (ReactElement.isValidElement(node)) {
9777 // This element was passed in a valid location.
9778 if (node._store) {
9779 node._store.validated = true;
9780 }
9781 } else if (node) {
9782 var iteratorFn = getIteratorFn(node);
9783 // Entry iterators provide implicit keys.
9784 if (iteratorFn) {
9785 if (iteratorFn !== node.entries) {
9786 var iterator = iteratorFn.call(node);
9787 var step;
9788 while (!(step = iterator.next()).done) {
9789 if (ReactElement.isValidElement(step.value)) {
9790 validateExplicitKey(step.value, parentType);
9791 }
9792 }
9793 }
9794 }
9795 }
9796}
9797
9798/**
9799 * Assert that the props are valid
9800 *
9801 * @param {string} componentName Name of the component for error messages.
9802 * @param {object} propTypes Map of prop name to a ReactPropType
9803 * @param {object} props
9804 * @param {string} location e.g. "prop", "context", "child context"
9805 * @private
9806 */
9807function checkPropTypes(componentName, propTypes, props, location) {
9808 for (var propName in propTypes) {
9809 if (propTypes.hasOwnProperty(propName)) {
9810 var error;
9811 // Prop type validation may throw. In case they do, we don't want to
9812 // fail the render phase where it didn't fail before. So we log it.
9813 // After these have been cleaned up, we'll let them throw.
9814 try {
9815 // This is intentionally an invariant that gets caught. It's the same
9816 // behavior as without this statement except with a better message.
9817 !(typeof propTypes[propName] === 'function') ? "development" !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], propName) : invariant(false) : undefined;
9818 error = propTypes[propName](props, propName, componentName, location);
9819 } catch (ex) {
9820 error = ex;
9821 }
9822 "development" !== 'production' ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', ReactPropTypeLocationNames[location], propName, typeof error) : undefined;
9823 if (error instanceof Error && !(error.message in loggedTypeFailures)) {
9824 // Only monitor this failure once because there tends to be a lot of the
9825 // same error.
9826 loggedTypeFailures[error.message] = true;
9827
9828 var addendum = getDeclarationErrorAddendum();
9829 "development" !== 'production' ? warning(false, 'Failed propType: %s%s', error.message, addendum) : undefined;
9830 }
9831 }
9832 }
9833}
9834
9835/**
9836 * Given an element, validate that its props follow the propTypes definition,
9837 * provided by the type.
9838 *
9839 * @param {ReactElement} element
9840 */
9841function validatePropTypes(element) {
9842 var componentClass = element.type;
9843 if (typeof componentClass !== 'function') {
9844 return;
9845 }
9846 var name = componentClass.displayName || componentClass.name;
9847 if (componentClass.propTypes) {
9848 checkPropTypes(name, componentClass.propTypes, element.props, ReactPropTypeLocations.prop);
9849 }
9850 if (typeof componentClass.getDefaultProps === 'function') {
9851 "development" !== 'production' ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : undefined;
9852 }
9853}
9854
9855var ReactElementValidator = {
9856
9857 createElement: function (type, props, children) {
9858 var validType = typeof type === 'string' || typeof type === 'function';
9859 // We warn in this case but don't throw. We expect the element creation to
9860 // succeed and there will likely be errors in render.
9861 "development" !== 'production' ? warning(validType, 'React.createElement: type should not be null, undefined, boolean, or ' + 'number. It should be a string (for DOM elements) or a ReactClass ' + '(for composite components).%s', getDeclarationErrorAddendum()) : undefined;
9862
9863 var element = ReactElement.createElement.apply(this, arguments);
9864
9865 // The result can be nullish if a mock or a custom function is used.
9866 // TODO: Drop this when these are no longer allowed as the type argument.
9867 if (element == null) {
9868 return element;
9869 }
9870
9871 // Skip key warning if the type isn't valid since our key validation logic
9872 // doesn't expect a non-string/function type and can throw confusing errors.
9873 // We don't want exception behavior to differ between dev and prod.
9874 // (Rendering will throw with a helpful message and as soon as the type is
9875 // fixed, the key warnings will appear.)
9876 if (validType) {
9877 for (var i = 2; i < arguments.length; i++) {
9878 validateChildKeys(arguments[i], type);
9879 }
9880 }
9881
9882 validatePropTypes(element);
9883
9884 return element;
9885 },
9886
9887 createFactory: function (type) {
9888 var validatedFactory = ReactElementValidator.createElement.bind(null, type);
9889 // Legacy hook TODO: Warn if this is accessed
9890 validatedFactory.type = type;
9891
9892 if ("development" !== 'production') {
9893 if (canDefineProperty) {
9894 Object.defineProperty(validatedFactory, 'type', {
9895 enumerable: false,
9896 get: function () {
9897 "development" !== 'production' ? warning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.') : undefined;
9898 Object.defineProperty(this, 'type', {
9899 value: type
9900 });
9901 return type;
9902 }
9903 });
9904 }
9905 }
9906
9907 return validatedFactory;
9908 },
9909
9910 cloneElement: function (element, props, children) {
9911 var newElement = ReactElement.cloneElement.apply(this, arguments);
9912 for (var i = 2; i < arguments.length; i++) {
9913 validateChildKeys(arguments[i], newElement.type);
9914 }
9915 validatePropTypes(newElement);
9916 return newElement;
9917 }
9918
9919};
9920
9921module.exports = ReactElementValidator;
9922},{"117":117,"129":129,"161":161,"173":173,"39":39,"57":57,"80":80,"81":81}],59:[function(_dereq_,module,exports){
9923/**
9924 * Copyright 2014-2015, Facebook, Inc.
9925 * All rights reserved.
9926 *
9927 * This source code is licensed under the BSD-style license found in the
9928 * LICENSE file in the root directory of this source tree. An additional grant
9929 * of patent rights can be found in the PATENTS file in the same directory.
9930 *
9931 * @providesModule ReactEmptyComponent
9932 */
9933
9934'use strict';
9935
9936var ReactElement = _dereq_(57);
9937var ReactEmptyComponentRegistry = _dereq_(60);
9938var ReactReconciler = _dereq_(84);
9939
9940var assign = _dereq_(24);
9941
9942var placeholderElement;
9943
9944var ReactEmptyComponentInjection = {
9945 injectEmptyComponent: function (component) {
9946 placeholderElement = ReactElement.createElement(component);
9947 }
9948};
9949
9950var ReactEmptyComponent = function (instantiate) {
9951 this._currentElement = null;
9952 this._rootNodeID = null;
9953 this._renderedComponent = instantiate(placeholderElement);
9954};
9955assign(ReactEmptyComponent.prototype, {
9956 construct: function (element) {},
9957 mountComponent: function (rootID, transaction, context) {
9958 ReactEmptyComponentRegistry.registerNullComponentID(rootID);
9959 this._rootNodeID = rootID;
9960 return ReactReconciler.mountComponent(this._renderedComponent, rootID, transaction, context);
9961 },
9962 receiveComponent: function () {},
9963 unmountComponent: function (rootID, transaction, context) {
9964 ReactReconciler.unmountComponent(this._renderedComponent);
9965 ReactEmptyComponentRegistry.deregisterNullComponentID(this._rootNodeID);
9966 this._rootNodeID = null;
9967 this._renderedComponent = null;
9968 }
9969});
9970
9971ReactEmptyComponent.injection = ReactEmptyComponentInjection;
9972
9973module.exports = ReactEmptyComponent;
9974},{"24":24,"57":57,"60":60,"84":84}],60:[function(_dereq_,module,exports){
9975/**
9976 * Copyright 2014-2015, Facebook, Inc.
9977 * All rights reserved.
9978 *
9979 * This source code is licensed under the BSD-style license found in the
9980 * LICENSE file in the root directory of this source tree. An additional grant
9981 * of patent rights can be found in the PATENTS file in the same directory.
9982 *
9983 * @providesModule ReactEmptyComponentRegistry
9984 */
9985
9986'use strict';
9987
9988// This registry keeps track of the React IDs of the components that rendered to
9989// `null` (in reality a placeholder such as `noscript`)
9990var nullComponentIDsRegistry = {};
9991
9992/**
9993 * @param {string} id Component's `_rootNodeID`.
9994 * @return {boolean} True if the component is rendered to null.
9995 */
9996function isNullComponentID(id) {
9997 return !!nullComponentIDsRegistry[id];
9998}
9999
10000/**
10001 * Mark the component as having rendered to null.
10002 * @param {string} id Component's `_rootNodeID`.
10003 */
10004function registerNullComponentID(id) {
10005 nullComponentIDsRegistry[id] = true;
10006}
10007
10008/**
10009 * Unmark the component as having rendered to null: it renders to something now.
10010 * @param {string} id Component's `_rootNodeID`.
10011 */
10012function deregisterNullComponentID(id) {
10013 delete nullComponentIDsRegistry[id];
10014}
10015
10016var ReactEmptyComponentRegistry = {
10017 isNullComponentID: isNullComponentID,
10018 registerNullComponentID: registerNullComponentID,
10019 deregisterNullComponentID: deregisterNullComponentID
10020};
10021
10022module.exports = ReactEmptyComponentRegistry;
10023},{}],61:[function(_dereq_,module,exports){
10024/**
10025 * Copyright 2013-2015, Facebook, Inc.
10026 * All rights reserved.
10027 *
10028 * This source code is licensed under the BSD-style license found in the
10029 * LICENSE file in the root directory of this source tree. An additional grant
10030 * of patent rights can be found in the PATENTS file in the same directory.
10031 *
10032 * @providesModule ReactErrorUtils
10033 * @typechecks
10034 */
10035
10036'use strict';
10037
10038var caughtError = null;
10039
10040/**
10041 * Call a function while guarding against errors that happens within it.
10042 *
10043 * @param {?String} name of the guard to use for logging or debugging
10044 * @param {Function} func The function to invoke
10045 * @param {*} a First argument
10046 * @param {*} b Second argument
10047 */
10048function invokeGuardedCallback(name, func, a, b) {
10049 try {
10050 return func(a, b);
10051 } catch (x) {
10052 if (caughtError === null) {
10053 caughtError = x;
10054 }
10055 return undefined;
10056 }
10057}
10058
10059var ReactErrorUtils = {
10060 invokeGuardedCallback: invokeGuardedCallback,
10061
10062 /**
10063 * Invoked by ReactTestUtils.Simulate so that any errors thrown by the event
10064 * handler are sure to be rethrown by rethrowCaughtError.
10065 */
10066 invokeGuardedCallbackWithCatch: invokeGuardedCallback,
10067
10068 /**
10069 * During execution of guarded functions we will capture the first error which
10070 * we will rethrow to be handled by the top level error handler.
10071 */
10072 rethrowCaughtError: function () {
10073 if (caughtError) {
10074 var error = caughtError;
10075 caughtError = null;
10076 throw error;
10077 }
10078 }
10079};
10080
10081if ("development" !== 'production') {
10082 /**
10083 * To help development we can get better devtools integration by simulating a
10084 * real browser event.
10085 */
10086 if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
10087 var fakeNode = document.createElement('react');
10088 ReactErrorUtils.invokeGuardedCallback = function (name, func, a, b) {
10089 var boundFunc = func.bind(null, a, b);
10090 var evtType = 'react-' + name;
10091 fakeNode.addEventListener(evtType, boundFunc, false);
10092 var evt = document.createEvent('Event');
10093 evt.initEvent(evtType, false, false);
10094 fakeNode.dispatchEvent(evt);
10095 fakeNode.removeEventListener(evtType, boundFunc, false);
10096 };
10097 }
10098}
10099
10100module.exports = ReactErrorUtils;
10101},{}],62:[function(_dereq_,module,exports){
10102/**
10103 * Copyright 2013-2015, Facebook, Inc.
10104 * All rights reserved.
10105 *
10106 * This source code is licensed under the BSD-style license found in the
10107 * LICENSE file in the root directory of this source tree. An additional grant
10108 * of patent rights can be found in the PATENTS file in the same directory.
10109 *
10110 * @providesModule ReactEventEmitterMixin
10111 */
10112
10113'use strict';
10114
10115var EventPluginHub = _dereq_(16);
10116
10117function runEventQueueInBatch(events) {
10118 EventPluginHub.enqueueEvents(events);
10119 EventPluginHub.processEventQueue(false);
10120}
10121
10122var ReactEventEmitterMixin = {
10123
10124 /**
10125 * Streams a fired top-level event to `EventPluginHub` where plugins have the
10126 * opportunity to create `ReactEvent`s to be dispatched.
10127 *
10128 * @param {string} topLevelType Record from `EventConstants`.
10129 * @param {object} topLevelTarget The listening component root node.
10130 * @param {string} topLevelTargetID ID of `topLevelTarget`.
10131 * @param {object} nativeEvent Native environment event.
10132 */
10133 handleTopLevel: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
10134 var events = EventPluginHub.extractEvents(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget);
10135 runEventQueueInBatch(events);
10136 }
10137};
10138
10139module.exports = ReactEventEmitterMixin;
10140},{"16":16}],63:[function(_dereq_,module,exports){
10141/**
10142 * Copyright 2013-2015, Facebook, Inc.
10143 * All rights reserved.
10144 *
10145 * This source code is licensed under the BSD-style license found in the
10146 * LICENSE file in the root directory of this source tree. An additional grant
10147 * of patent rights can be found in the PATENTS file in the same directory.
10148 *
10149 * @providesModule ReactEventListener
10150 * @typechecks static-only
10151 */
10152
10153'use strict';
10154
10155var EventListener = _dereq_(146);
10156var ExecutionEnvironment = _dereq_(147);
10157var PooledClass = _dereq_(25);
10158var ReactInstanceHandles = _dereq_(67);
10159var ReactMount = _dereq_(72);
10160var ReactUpdates = _dereq_(96);
10161
10162var assign = _dereq_(24);
10163var getEventTarget = _dereq_(128);
10164var getUnboundedScrollPosition = _dereq_(158);
10165
10166var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
10167
10168/**
10169 * Finds the parent React component of `node`.
10170 *
10171 * @param {*} node
10172 * @return {?DOMEventTarget} Parent container, or `null` if the specified node
10173 * is not nested.
10174 */
10175function findParent(node) {
10176 // TODO: It may be a good idea to cache this to prevent unnecessary DOM
10177 // traversal, but caching is difficult to do correctly without using a
10178 // mutation observer to listen for all DOM changes.
10179 var nodeID = ReactMount.getID(node);
10180 var rootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);
10181 var container = ReactMount.findReactContainerForID(rootID);
10182 var parent = ReactMount.getFirstReactDOM(container);
10183 return parent;
10184}
10185
10186// Used to store ancestor hierarchy in top level callback
10187function TopLevelCallbackBookKeeping(topLevelType, nativeEvent) {
10188 this.topLevelType = topLevelType;
10189 this.nativeEvent = nativeEvent;
10190 this.ancestors = [];
10191}
10192assign(TopLevelCallbackBookKeeping.prototype, {
10193 destructor: function () {
10194 this.topLevelType = null;
10195 this.nativeEvent = null;
10196 this.ancestors.length = 0;
10197 }
10198});
10199PooledClass.addPoolingTo(TopLevelCallbackBookKeeping, PooledClass.twoArgumentPooler);
10200
10201function handleTopLevelImpl(bookKeeping) {
10202 // TODO: Re-enable event.path handling
10203 //
10204 // if (bookKeeping.nativeEvent.path && bookKeeping.nativeEvent.path.length > 1) {
10205 // // New browsers have a path attribute on native events
10206 // handleTopLevelWithPath(bookKeeping);
10207 // } else {
10208 // // Legacy browsers don't have a path attribute on native events
10209 // handleTopLevelWithoutPath(bookKeeping);
10210 // }
10211
10212 void handleTopLevelWithPath; // temporarily unused
10213 handleTopLevelWithoutPath(bookKeeping);
10214}
10215
10216// Legacy browsers don't have a path attribute on native events
10217function handleTopLevelWithoutPath(bookKeeping) {
10218 var topLevelTarget = ReactMount.getFirstReactDOM(getEventTarget(bookKeeping.nativeEvent)) || window;
10219
10220 // Loop through the hierarchy, in case there's any nested components.
10221 // It's important that we build the array of ancestors before calling any
10222 // event handlers, because event handlers can modify the DOM, leading to
10223 // inconsistencies with ReactMount's node cache. See #1105.
10224 var ancestor = topLevelTarget;
10225 while (ancestor) {
10226 bookKeeping.ancestors.push(ancestor);
10227 ancestor = findParent(ancestor);
10228 }
10229
10230 for (var i = 0; i < bookKeeping.ancestors.length; i++) {
10231 topLevelTarget = bookKeeping.ancestors[i];
10232 var topLevelTargetID = ReactMount.getID(topLevelTarget) || '';
10233 ReactEventListener._handleTopLevel(bookKeeping.topLevelType, topLevelTarget, topLevelTargetID, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
10234 }
10235}
10236
10237// New browsers have a path attribute on native events
10238function handleTopLevelWithPath(bookKeeping) {
10239 var path = bookKeeping.nativeEvent.path;
10240 var currentNativeTarget = path[0];
10241 var eventsFired = 0;
10242 for (var i = 0; i < path.length; i++) {
10243 var currentPathElement = path[i];
10244 if (currentPathElement.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE) {
10245 currentNativeTarget = path[i + 1];
10246 }
10247 // TODO: slow
10248 var reactParent = ReactMount.getFirstReactDOM(currentPathElement);
10249 if (reactParent === currentPathElement) {
10250 var currentPathElementID = ReactMount.getID(currentPathElement);
10251 var newRootID = ReactInstanceHandles.getReactRootIDFromNodeID(currentPathElementID);
10252 bookKeeping.ancestors.push(currentPathElement);
10253
10254 var topLevelTargetID = ReactMount.getID(currentPathElement) || '';
10255 eventsFired++;
10256 ReactEventListener._handleTopLevel(bookKeeping.topLevelType, currentPathElement, topLevelTargetID, bookKeeping.nativeEvent, currentNativeTarget);
10257
10258 // Jump to the root of this React render tree
10259 while (currentPathElementID !== newRootID) {
10260 i++;
10261 currentPathElement = path[i];
10262 currentPathElementID = ReactMount.getID(currentPathElement);
10263 }
10264 }
10265 }
10266 if (eventsFired === 0) {
10267 ReactEventListener._handleTopLevel(bookKeeping.topLevelType, window, '', bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
10268 }
10269}
10270
10271function scrollValueMonitor(cb) {
10272 var scrollPosition = getUnboundedScrollPosition(window);
10273 cb(scrollPosition);
10274}
10275
10276var ReactEventListener = {
10277 _enabled: true,
10278 _handleTopLevel: null,
10279
10280 WINDOW_HANDLE: ExecutionEnvironment.canUseDOM ? window : null,
10281
10282 setHandleTopLevel: function (handleTopLevel) {
10283 ReactEventListener._handleTopLevel = handleTopLevel;
10284 },
10285
10286 setEnabled: function (enabled) {
10287 ReactEventListener._enabled = !!enabled;
10288 },
10289
10290 isEnabled: function () {
10291 return ReactEventListener._enabled;
10292 },
10293
10294 /**
10295 * Traps top-level events by using event bubbling.
10296 *
10297 * @param {string} topLevelType Record from `EventConstants`.
10298 * @param {string} handlerBaseName Event name (e.g. "click").
10299 * @param {object} handle Element on which to attach listener.
10300 * @return {?object} An object with a remove function which will forcefully
10301 * remove the listener.
10302 * @internal
10303 */
10304 trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {
10305 var element = handle;
10306 if (!element) {
10307 return null;
10308 }
10309 return EventListener.listen(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
10310 },
10311
10312 /**
10313 * Traps a top-level event by using event capturing.
10314 *
10315 * @param {string} topLevelType Record from `EventConstants`.
10316 * @param {string} handlerBaseName Event name (e.g. "click").
10317 * @param {object} handle Element on which to attach listener.
10318 * @return {?object} An object with a remove function which will forcefully
10319 * remove the listener.
10320 * @internal
10321 */
10322 trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {
10323 var element = handle;
10324 if (!element) {
10325 return null;
10326 }
10327 return EventListener.capture(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
10328 },
10329
10330 monitorScrollValue: function (refresh) {
10331 var callback = scrollValueMonitor.bind(null, refresh);
10332 EventListener.listen(window, 'scroll', callback);
10333 },
10334
10335 dispatchEvent: function (topLevelType, nativeEvent) {
10336 if (!ReactEventListener._enabled) {
10337 return;
10338 }
10339
10340 var bookKeeping = TopLevelCallbackBookKeeping.getPooled(topLevelType, nativeEvent);
10341 try {
10342 // Event queue being processed in the same cycle allows
10343 // `preventDefault`.
10344 ReactUpdates.batchedUpdates(handleTopLevelImpl, bookKeeping);
10345 } finally {
10346 TopLevelCallbackBookKeeping.release(bookKeeping);
10347 }
10348 }
10349};
10350
10351module.exports = ReactEventListener;
10352},{"128":128,"146":146,"147":147,"158":158,"24":24,"25":25,"67":67,"72":72,"96":96}],64:[function(_dereq_,module,exports){
10353/**
10354 * Copyright 2015, Facebook, Inc.
10355 * All rights reserved.
10356 *
10357 * This source code is licensed under the BSD-style license found in the
10358 * LICENSE file in the root directory of this source tree. An additional grant
10359 * of patent rights can be found in the PATENTS file in the same directory.
10360 *
10361 * @providesModule ReactFragment
10362 */
10363
10364'use strict';
10365
10366var ReactChildren = _dereq_(32);
10367var ReactElement = _dereq_(57);
10368
10369var emptyFunction = _dereq_(153);
10370var invariant = _dereq_(161);
10371var warning = _dereq_(173);
10372
10373/**
10374 * We used to allow keyed objects to serve as a collection of ReactElements,
10375 * or nested sets. This allowed us a way to explicitly key a set a fragment of
10376 * components. This is now being replaced with an opaque data structure.
10377 * The upgrade path is to call React.addons.createFragment({ key: value }) to
10378 * create a keyed fragment. The resulting data structure is an array.
10379 */
10380
10381var numericPropertyRegex = /^\d+$/;
10382
10383var warnedAboutNumeric = false;
10384
10385var ReactFragment = {
10386 // Wrap a keyed object in an opaque proxy that warns you if you access any
10387 // of its properties.
10388 create: function (object) {
10389 if (typeof object !== 'object' || !object || Array.isArray(object)) {
10390 "development" !== 'production' ? warning(false, 'React.addons.createFragment only accepts a single object. Got: %s', object) : undefined;
10391 return object;
10392 }
10393 if (ReactElement.isValidElement(object)) {
10394 "development" !== 'production' ? warning(false, 'React.addons.createFragment does not accept a ReactElement ' + 'without a wrapper object.') : undefined;
10395 return object;
10396 }
10397
10398 !(object.nodeType !== 1) ? "development" !== 'production' ? invariant(false, 'React.addons.createFragment(...): Encountered an invalid child; DOM ' + 'elements are not valid children of React components.') : invariant(false) : undefined;
10399
10400 var result = [];
10401
10402 for (var key in object) {
10403 if ("development" !== 'production') {
10404 if (!warnedAboutNumeric && numericPropertyRegex.test(key)) {
10405 "development" !== 'production' ? warning(false, 'React.addons.createFragment(...): Child objects should have ' + 'non-numeric keys so ordering is preserved.') : undefined;
10406 warnedAboutNumeric = true;
10407 }
10408 }
10409 ReactChildren.mapIntoWithKeyPrefixInternal(object[key], result, key, emptyFunction.thatReturnsArgument);
10410 }
10411
10412 return result;
10413 }
10414};
10415
10416module.exports = ReactFragment;
10417},{"153":153,"161":161,"173":173,"32":32,"57":57}],65:[function(_dereq_,module,exports){
10418/**
10419 * Copyright 2013-2015, Facebook, Inc.
10420 * All rights reserved.
10421 *
10422 * This source code is licensed under the BSD-style license found in the
10423 * LICENSE file in the root directory of this source tree. An additional grant
10424 * of patent rights can be found in the PATENTS file in the same directory.
10425 *
10426 * @providesModule ReactInjection
10427 */
10428
10429'use strict';
10430
10431var DOMProperty = _dereq_(10);
10432var EventPluginHub = _dereq_(16);
10433var ReactComponentEnvironment = _dereq_(36);
10434var ReactClass = _dereq_(33);
10435var ReactEmptyComponent = _dereq_(59);
10436var ReactBrowserEventEmitter = _dereq_(28);
10437var ReactNativeComponent = _dereq_(75);
10438var ReactPerf = _dereq_(78);
10439var ReactRootIndex = _dereq_(86);
10440var ReactUpdates = _dereq_(96);
10441
10442var ReactInjection = {
10443 Component: ReactComponentEnvironment.injection,
10444 Class: ReactClass.injection,
10445 DOMProperty: DOMProperty.injection,
10446 EmptyComponent: ReactEmptyComponent.injection,
10447 EventPluginHub: EventPluginHub.injection,
10448 EventEmitter: ReactBrowserEventEmitter.injection,
10449 NativeComponent: ReactNativeComponent.injection,
10450 Perf: ReactPerf.injection,
10451 RootIndex: ReactRootIndex.injection,
10452 Updates: ReactUpdates.injection
10453};
10454
10455module.exports = ReactInjection;
10456},{"10":10,"16":16,"28":28,"33":33,"36":36,"59":59,"75":75,"78":78,"86":86,"96":96}],66:[function(_dereq_,module,exports){
10457/**
10458 * Copyright 2013-2015, Facebook, Inc.
10459 * All rights reserved.
10460 *
10461 * This source code is licensed under the BSD-style license found in the
10462 * LICENSE file in the root directory of this source tree. An additional grant
10463 * of patent rights can be found in the PATENTS file in the same directory.
10464 *
10465 * @providesModule ReactInputSelection
10466 */
10467
10468'use strict';
10469
10470var ReactDOMSelection = _dereq_(49);
10471
10472var containsNode = _dereq_(150);
10473var focusNode = _dereq_(155);
10474var getActiveElement = _dereq_(156);
10475
10476function isInDocument(node) {
10477 return containsNode(document.documentElement, node);
10478}
10479
10480/**
10481 * @ReactInputSelection: React input selection module. Based on Selection.js,
10482 * but modified to be suitable for react and has a couple of bug fixes (doesn't
10483 * assume buttons have range selections allowed).
10484 * Input selection module for React.
10485 */
10486var ReactInputSelection = {
10487
10488 hasSelectionCapabilities: function (elem) {
10489 var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
10490 return nodeName && (nodeName === 'input' && elem.type === 'text' || nodeName === 'textarea' || elem.contentEditable === 'true');
10491 },
10492
10493 getSelectionInformation: function () {
10494 var focusedElem = getActiveElement();
10495 return {
10496 focusedElem: focusedElem,
10497 selectionRange: ReactInputSelection.hasSelectionCapabilities(focusedElem) ? ReactInputSelection.getSelection(focusedElem) : null
10498 };
10499 },
10500
10501 /**
10502 * @restoreSelection: If any selection information was potentially lost,
10503 * restore it. This is useful when performing operations that could remove dom
10504 * nodes and place them back in, resulting in focus being lost.
10505 */
10506 restoreSelection: function (priorSelectionInformation) {
10507 var curFocusedElem = getActiveElement();
10508 var priorFocusedElem = priorSelectionInformation.focusedElem;
10509 var priorSelectionRange = priorSelectionInformation.selectionRange;
10510 if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
10511 if (ReactInputSelection.hasSelectionCapabilities(priorFocusedElem)) {
10512 ReactInputSelection.setSelection(priorFocusedElem, priorSelectionRange);
10513 }
10514 focusNode(priorFocusedElem);
10515 }
10516 },
10517
10518 /**
10519 * @getSelection: Gets the selection bounds of a focused textarea, input or
10520 * contentEditable node.
10521 * -@input: Look up selection bounds of this input
10522 * -@return {start: selectionStart, end: selectionEnd}
10523 */
10524 getSelection: function (input) {
10525 var selection;
10526
10527 if ('selectionStart' in input) {
10528 // Modern browser with input or textarea.
10529 selection = {
10530 start: input.selectionStart,
10531 end: input.selectionEnd
10532 };
10533 } else if (document.selection && (input.nodeName && input.nodeName.toLowerCase() === 'input')) {
10534 // IE8 input.
10535 var range = document.selection.createRange();
10536 // There can only be one selection per document in IE, so it must
10537 // be in our element.
10538 if (range.parentElement() === input) {
10539 selection = {
10540 start: -range.moveStart('character', -input.value.length),
10541 end: -range.moveEnd('character', -input.value.length)
10542 };
10543 }
10544 } else {
10545 // Content editable or old IE textarea.
10546 selection = ReactDOMSelection.getOffsets(input);
10547 }
10548
10549 return selection || { start: 0, end: 0 };
10550 },
10551
10552 /**
10553 * @setSelection: Sets the selection bounds of a textarea or input and focuses
10554 * the input.
10555 * -@input Set selection bounds of this input or textarea
10556 * -@offsets Object of same form that is returned from get*
10557 */
10558 setSelection: function (input, offsets) {
10559 var start = offsets.start;
10560 var end = offsets.end;
10561 if (typeof end === 'undefined') {
10562 end = start;
10563 }
10564
10565 if ('selectionStart' in input) {
10566 input.selectionStart = start;
10567 input.selectionEnd = Math.min(end, input.value.length);
10568 } else if (document.selection && (input.nodeName && input.nodeName.toLowerCase() === 'input')) {
10569 var range = input.createTextRange();
10570 range.collapse(true);
10571 range.moveStart('character', start);
10572 range.moveEnd('character', end - start);
10573 range.select();
10574 } else {
10575 ReactDOMSelection.setOffsets(input, offsets);
10576 }
10577 }
10578};
10579
10580module.exports = ReactInputSelection;
10581},{"150":150,"155":155,"156":156,"49":49}],67:[function(_dereq_,module,exports){
10582/**
10583 * Copyright 2013-2015, Facebook, Inc.
10584 * All rights reserved.
10585 *
10586 * This source code is licensed under the BSD-style license found in the
10587 * LICENSE file in the root directory of this source tree. An additional grant
10588 * of patent rights can be found in the PATENTS file in the same directory.
10589 *
10590 * @providesModule ReactInstanceHandles
10591 * @typechecks static-only
10592 */
10593
10594'use strict';
10595
10596var ReactRootIndex = _dereq_(86);
10597
10598var invariant = _dereq_(161);
10599
10600var SEPARATOR = '.';
10601var SEPARATOR_LENGTH = SEPARATOR.length;
10602
10603/**
10604 * Maximum depth of traversals before we consider the possibility of a bad ID.
10605 */
10606var MAX_TREE_DEPTH = 10000;
10607
10608/**
10609 * Creates a DOM ID prefix to use when mounting React components.
10610 *
10611 * @param {number} index A unique integer
10612 * @return {string} React root ID.
10613 * @internal
10614 */
10615function getReactRootIDString(index) {
10616 return SEPARATOR + index.toString(36);
10617}
10618
10619/**
10620 * Checks if a character in the supplied ID is a separator or the end.
10621 *
10622 * @param {string} id A React DOM ID.
10623 * @param {number} index Index of the character to check.
10624 * @return {boolean} True if the character is a separator or end of the ID.
10625 * @private
10626 */
10627function isBoundary(id, index) {
10628 return id.charAt(index) === SEPARATOR || index === id.length;
10629}
10630
10631/**
10632 * Checks if the supplied string is a valid React DOM ID.
10633 *
10634 * @param {string} id A React DOM ID, maybe.
10635 * @return {boolean} True if the string is a valid React DOM ID.
10636 * @private
10637 */
10638function isValidID(id) {
10639 return id === '' || id.charAt(0) === SEPARATOR && id.charAt(id.length - 1) !== SEPARATOR;
10640}
10641
10642/**
10643 * Checks if the first ID is an ancestor of or equal to the second ID.
10644 *
10645 * @param {string} ancestorID
10646 * @param {string} descendantID
10647 * @return {boolean} True if `ancestorID` is an ancestor of `descendantID`.
10648 * @internal
10649 */
10650function isAncestorIDOf(ancestorID, descendantID) {
10651 return descendantID.indexOf(ancestorID) === 0 && isBoundary(descendantID, ancestorID.length);
10652}
10653
10654/**
10655 * Gets the parent ID of the supplied React DOM ID, `id`.
10656 *
10657 * @param {string} id ID of a component.
10658 * @return {string} ID of the parent, or an empty string.
10659 * @private
10660 */
10661function getParentID(id) {
10662 return id ? id.substr(0, id.lastIndexOf(SEPARATOR)) : '';
10663}
10664
10665/**
10666 * Gets the next DOM ID on the tree path from the supplied `ancestorID` to the
10667 * supplied `destinationID`. If they are equal, the ID is returned.
10668 *
10669 * @param {string} ancestorID ID of an ancestor node of `destinationID`.
10670 * @param {string} destinationID ID of the destination node.
10671 * @return {string} Next ID on the path from `ancestorID` to `destinationID`.
10672 * @private
10673 */
10674function getNextDescendantID(ancestorID, destinationID) {
10675 !(isValidID(ancestorID) && isValidID(destinationID)) ? "development" !== 'production' ? invariant(false, 'getNextDescendantID(%s, %s): Received an invalid React DOM ID.', ancestorID, destinationID) : invariant(false) : undefined;
10676 !isAncestorIDOf(ancestorID, destinationID) ? "development" !== 'production' ? invariant(false, 'getNextDescendantID(...): React has made an invalid assumption about ' + 'the DOM hierarchy. Expected `%s` to be an ancestor of `%s`.', ancestorID, destinationID) : invariant(false) : undefined;
10677 if (ancestorID === destinationID) {
10678 return ancestorID;
10679 }
10680 // Skip over the ancestor and the immediate separator. Traverse until we hit
10681 // another separator or we reach the end of `destinationID`.
10682 var start = ancestorID.length + SEPARATOR_LENGTH;
10683 var i;
10684 for (i = start; i < destinationID.length; i++) {
10685 if (isBoundary(destinationID, i)) {
10686 break;
10687 }
10688 }
10689 return destinationID.substr(0, i);
10690}
10691
10692/**
10693 * Gets the nearest common ancestor ID of two IDs.
10694 *
10695 * Using this ID scheme, the nearest common ancestor ID is the longest common
10696 * prefix of the two IDs that immediately preceded a "marker" in both strings.
10697 *
10698 * @param {string} oneID
10699 * @param {string} twoID
10700 * @return {string} Nearest common ancestor ID, or the empty string if none.
10701 * @private
10702 */
10703function getFirstCommonAncestorID(oneID, twoID) {
10704 var minLength = Math.min(oneID.length, twoID.length);
10705 if (minLength === 0) {
10706 return '';
10707 }
10708 var lastCommonMarkerIndex = 0;
10709 // Use `<=` to traverse until the "EOL" of the shorter string.
10710 for (var i = 0; i <= minLength; i++) {
10711 if (isBoundary(oneID, i) && isBoundary(twoID, i)) {
10712 lastCommonMarkerIndex = i;
10713 } else if (oneID.charAt(i) !== twoID.charAt(i)) {
10714 break;
10715 }
10716 }
10717 var longestCommonID = oneID.substr(0, lastCommonMarkerIndex);
10718 !isValidID(longestCommonID) ? "development" !== 'production' ? invariant(false, 'getFirstCommonAncestorID(%s, %s): Expected a valid React DOM ID: %s', oneID, twoID, longestCommonID) : invariant(false) : undefined;
10719 return longestCommonID;
10720}
10721
10722/**
10723 * Traverses the parent path between two IDs (either up or down). The IDs must
10724 * not be the same, and there must exist a parent path between them. If the
10725 * callback returns `false`, traversal is stopped.
10726 *
10727 * @param {?string} start ID at which to start traversal.
10728 * @param {?string} stop ID at which to end traversal.
10729 * @param {function} cb Callback to invoke each ID with.
10730 * @param {*} arg Argument to invoke the callback with.
10731 * @param {?boolean} skipFirst Whether or not to skip the first node.
10732 * @param {?boolean} skipLast Whether or not to skip the last node.
10733 * @private
10734 */
10735function traverseParentPath(start, stop, cb, arg, skipFirst, skipLast) {
10736 start = start || '';
10737 stop = stop || '';
10738 !(start !== stop) ? "development" !== 'production' ? invariant(false, 'traverseParentPath(...): Cannot traverse from and to the same ID, `%s`.', start) : invariant(false) : undefined;
10739 var traverseUp = isAncestorIDOf(stop, start);
10740 !(traverseUp || isAncestorIDOf(start, stop)) ? "development" !== 'production' ? invariant(false, 'traverseParentPath(%s, %s, ...): Cannot traverse from two IDs that do ' + 'not have a parent path.', start, stop) : invariant(false) : undefined;
10741 // Traverse from `start` to `stop` one depth at a time.
10742 var depth = 0;
10743 var traverse = traverseUp ? getParentID : getNextDescendantID;
10744 for (var id = start;; /* until break */id = traverse(id, stop)) {
10745 var ret;
10746 if ((!skipFirst || id !== start) && (!skipLast || id !== stop)) {
10747 ret = cb(id, traverseUp, arg);
10748 }
10749 if (ret === false || id === stop) {
10750 // Only break //after// visiting `stop`.
10751 break;
10752 }
10753 !(depth++ < MAX_TREE_DEPTH) ? "development" !== 'production' ? invariant(false, 'traverseParentPath(%s, %s, ...): Detected an infinite loop while ' + 'traversing the React DOM ID tree. This may be due to malformed IDs: %s', start, stop, id) : invariant(false) : undefined;
10754 }
10755}
10756
10757/**
10758 * Manages the IDs assigned to DOM representations of React components. This
10759 * uses a specific scheme in order to traverse the DOM efficiently (e.g. in
10760 * order to simulate events).
10761 *
10762 * @internal
10763 */
10764var ReactInstanceHandles = {
10765
10766 /**
10767 * Constructs a React root ID
10768 * @return {string} A React root ID.
10769 */
10770 createReactRootID: function () {
10771 return getReactRootIDString(ReactRootIndex.createReactRootIndex());
10772 },
10773
10774 /**
10775 * Constructs a React ID by joining a root ID with a name.
10776 *
10777 * @param {string} rootID Root ID of a parent component.
10778 * @param {string} name A component's name (as flattened children).
10779 * @return {string} A React ID.
10780 * @internal
10781 */
10782 createReactID: function (rootID, name) {
10783 return rootID + name;
10784 },
10785
10786 /**
10787 * Gets the DOM ID of the React component that is the root of the tree that
10788 * contains the React component with the supplied DOM ID.
10789 *
10790 * @param {string} id DOM ID of a React component.
10791 * @return {?string} DOM ID of the React component that is the root.
10792 * @internal
10793 */
10794 getReactRootIDFromNodeID: function (id) {
10795 if (id && id.charAt(0) === SEPARATOR && id.length > 1) {
10796 var index = id.indexOf(SEPARATOR, 1);
10797 return index > -1 ? id.substr(0, index) : id;
10798 }
10799 return null;
10800 },
10801
10802 /**
10803 * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that
10804 * should would receive a `mouseEnter` or `mouseLeave` event.
10805 *
10806 * NOTE: Does not invoke the callback on the nearest common ancestor because
10807 * nothing "entered" or "left" that element.
10808 *
10809 * @param {string} leaveID ID being left.
10810 * @param {string} enterID ID being entered.
10811 * @param {function} cb Callback to invoke on each entered/left ID.
10812 * @param {*} upArg Argument to invoke the callback with on left IDs.
10813 * @param {*} downArg Argument to invoke the callback with on entered IDs.
10814 * @internal
10815 */
10816 traverseEnterLeave: function (leaveID, enterID, cb, upArg, downArg) {
10817 var ancestorID = getFirstCommonAncestorID(leaveID, enterID);
10818 if (ancestorID !== leaveID) {
10819 traverseParentPath(leaveID, ancestorID, cb, upArg, false, true);
10820 }
10821 if (ancestorID !== enterID) {
10822 traverseParentPath(ancestorID, enterID, cb, downArg, true, false);
10823 }
10824 },
10825
10826 /**
10827 * Simulates the traversal of a two-phase, capture/bubble event dispatch.
10828 *
10829 * NOTE: This traversal happens on IDs without touching the DOM.
10830 *
10831 * @param {string} targetID ID of the target node.
10832 * @param {function} cb Callback to invoke.
10833 * @param {*} arg Argument to invoke the callback with.
10834 * @internal
10835 */
10836 traverseTwoPhase: function (targetID, cb, arg) {
10837 if (targetID) {
10838 traverseParentPath('', targetID, cb, arg, true, false);
10839 traverseParentPath(targetID, '', cb, arg, false, true);
10840 }
10841 },
10842
10843 /**
10844 * Same as `traverseTwoPhase` but skips the `targetID`.
10845 */
10846 traverseTwoPhaseSkipTarget: function (targetID, cb, arg) {
10847 if (targetID) {
10848 traverseParentPath('', targetID, cb, arg, true, true);
10849 traverseParentPath(targetID, '', cb, arg, true, true);
10850 }
10851 },
10852
10853 /**
10854 * Traverse a node ID, calling the supplied `cb` for each ancestor ID. For
10855 * example, passing `.0.$row-0.1` would result in `cb` getting called
10856 * with `.0`, `.0.$row-0`, and `.0.$row-0.1`.
10857 *
10858 * NOTE: This traversal happens on IDs without touching the DOM.
10859 *
10860 * @param {string} targetID ID of the target node.
10861 * @param {function} cb Callback to invoke.
10862 * @param {*} arg Argument to invoke the callback with.
10863 * @internal
10864 */
10865 traverseAncestors: function (targetID, cb, arg) {
10866 traverseParentPath('', targetID, cb, arg, true, false);
10867 },
10868
10869 getFirstCommonAncestorID: getFirstCommonAncestorID,
10870
10871 /**
10872 * Exposed for unit testing.
10873 * @private
10874 */
10875 _getNextDescendantID: getNextDescendantID,
10876
10877 isAncestorIDOf: isAncestorIDOf,
10878
10879 SEPARATOR: SEPARATOR
10880
10881};
10882
10883module.exports = ReactInstanceHandles;
10884},{"161":161,"86":86}],68:[function(_dereq_,module,exports){
10885/**
10886 * Copyright 2013-2015, Facebook, Inc.
10887 * All rights reserved.
10888 *
10889 * This source code is licensed under the BSD-style license found in the
10890 * LICENSE file in the root directory of this source tree. An additional grant
10891 * of patent rights can be found in the PATENTS file in the same directory.
10892 *
10893 * @providesModule ReactInstanceMap
10894 */
10895
10896'use strict';
10897
10898/**
10899 * `ReactInstanceMap` maintains a mapping from a public facing stateful
10900 * instance (key) and the internal representation (value). This allows public
10901 * methods to accept the user facing instance as an argument and map them back
10902 * to internal methods.
10903 */
10904
10905// TODO: Replace this with ES6: var ReactInstanceMap = new Map();
10906var ReactInstanceMap = {
10907
10908 /**
10909 * This API should be called `delete` but we'd have to make sure to always
10910 * transform these to strings for IE support. When this transform is fully
10911 * supported we can rename it.
10912 */
10913 remove: function (key) {
10914 key._reactInternalInstance = undefined;
10915 },
10916
10917 get: function (key) {
10918 return key._reactInternalInstance;
10919 },
10920
10921 has: function (key) {
10922 return key._reactInternalInstance !== undefined;
10923 },
10924
10925 set: function (key, value) {
10926 key._reactInternalInstance = value;
10927 }
10928
10929};
10930
10931module.exports = ReactInstanceMap;
10932},{}],69:[function(_dereq_,module,exports){
10933/**
10934 * Copyright 2013-2015, Facebook, Inc.
10935 * All rights reserved.
10936 *
10937 * This source code is licensed under the BSD-style license found in the
10938 * LICENSE file in the root directory of this source tree. An additional grant
10939 * of patent rights can be found in the PATENTS file in the same directory.
10940 *
10941 * @providesModule ReactIsomorphic
10942 */
10943
10944'use strict';
10945
10946var ReactChildren = _dereq_(32);
10947var ReactComponent = _dereq_(34);
10948var ReactClass = _dereq_(33);
10949var ReactDOMFactories = _dereq_(43);
10950var ReactElement = _dereq_(57);
10951var ReactElementValidator = _dereq_(58);
10952var ReactPropTypes = _dereq_(82);
10953var ReactVersion = _dereq_(97);
10954
10955var assign = _dereq_(24);
10956var onlyChild = _dereq_(135);
10957
10958var createElement = ReactElement.createElement;
10959var createFactory = ReactElement.createFactory;
10960var cloneElement = ReactElement.cloneElement;
10961
10962if ("development" !== 'production') {
10963 createElement = ReactElementValidator.createElement;
10964 createFactory = ReactElementValidator.createFactory;
10965 cloneElement = ReactElementValidator.cloneElement;
10966}
10967
10968var React = {
10969
10970 // Modern
10971
10972 Children: {
10973 map: ReactChildren.map,
10974 forEach: ReactChildren.forEach,
10975 count: ReactChildren.count,
10976 toArray: ReactChildren.toArray,
10977 only: onlyChild
10978 },
10979
10980 Component: ReactComponent,
10981
10982 createElement: createElement,
10983 cloneElement: cloneElement,
10984 isValidElement: ReactElement.isValidElement,
10985
10986 // Classic
10987
10988 PropTypes: ReactPropTypes,
10989 createClass: ReactClass.createClass,
10990 createFactory: createFactory,
10991 createMixin: function (mixin) {
10992 // Currently a noop. Will be used to validate and trace mixins.
10993 return mixin;
10994 },
10995
10996 // This looks DOM specific but these are actually isomorphic helpers
10997 // since they are just generating DOM strings.
10998 DOM: ReactDOMFactories,
10999
11000 version: ReactVersion,
11001
11002 // Hook for JSX spread, don't use this for anything else.
11003 __spread: assign
11004};
11005
11006module.exports = React;
11007},{"135":135,"24":24,"32":32,"33":33,"34":34,"43":43,"57":57,"58":58,"82":82,"97":97}],70:[function(_dereq_,module,exports){
11008/**
11009 * Copyright 2013-2015, Facebook, Inc.
11010 * All rights reserved.
11011 *
11012 * This source code is licensed under the BSD-style license found in the
11013 * LICENSE file in the root directory of this source tree. An additional grant
11014 * of patent rights can be found in the PATENTS file in the same directory.
11015 *
11016 * @providesModule ReactLink
11017 * @typechecks static-only
11018 */
11019
11020'use strict';
11021
11022/**
11023 * ReactLink encapsulates a common pattern in which a component wants to modify
11024 * a prop received from its parent. ReactLink allows the parent to pass down a
11025 * value coupled with a callback that, when invoked, expresses an intent to
11026 * modify that value. For example:
11027 *
11028 * React.createClass({
11029 * getInitialState: function() {
11030 * return {value: ''};
11031 * },
11032 * render: function() {
11033 * var valueLink = new ReactLink(this.state.value, this._handleValueChange);
11034 * return <input valueLink={valueLink} />;
11035 * },
11036 * _handleValueChange: function(newValue) {
11037 * this.setState({value: newValue});
11038 * }
11039 * });
11040 *
11041 * We have provided some sugary mixins to make the creation and
11042 * consumption of ReactLink easier; see LinkedValueUtils and LinkedStateMixin.
11043 */
11044
11045var React = _dereq_(26);
11046
11047/**
11048 * @param {*} value current value of the link
11049 * @param {function} requestChange callback to request a change
11050 */
11051function ReactLink(value, requestChange) {
11052 this.value = value;
11053 this.requestChange = requestChange;
11054}
11055
11056/**
11057 * Creates a PropType that enforces the ReactLink API and optionally checks the
11058 * type of the value being passed inside the link. Example:
11059 *
11060 * MyComponent.propTypes = {
11061 * tabIndexLink: ReactLink.PropTypes.link(React.PropTypes.number)
11062 * }
11063 */
11064function createLinkTypeChecker(linkType) {
11065 var shapes = {
11066 value: typeof linkType === 'undefined' ? React.PropTypes.any.isRequired : linkType.isRequired,
11067 requestChange: React.PropTypes.func.isRequired
11068 };
11069 return React.PropTypes.shape(shapes);
11070}
11071
11072ReactLink.PropTypes = {
11073 link: createLinkTypeChecker
11074};
11075
11076module.exports = ReactLink;
11077},{"26":26}],71:[function(_dereq_,module,exports){
11078/**
11079 * Copyright 2013-2015, Facebook, Inc.
11080 * All rights reserved.
11081 *
11082 * This source code is licensed under the BSD-style license found in the
11083 * LICENSE file in the root directory of this source tree. An additional grant
11084 * of patent rights can be found in the PATENTS file in the same directory.
11085 *
11086 * @providesModule ReactMarkupChecksum
11087 */
11088
11089'use strict';
11090
11091var adler32 = _dereq_(116);
11092
11093var TAG_END = /\/?>/;
11094
11095var ReactMarkupChecksum = {
11096 CHECKSUM_ATTR_NAME: 'data-react-checksum',
11097
11098 /**
11099 * @param {string} markup Markup string
11100 * @return {string} Markup string with checksum attribute attached
11101 */
11102 addChecksumToMarkup: function (markup) {
11103 var checksum = adler32(markup);
11104
11105 // Add checksum (handle both parent tags and self-closing tags)
11106 return markup.replace(TAG_END, ' ' + ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '="' + checksum + '"$&');
11107 },
11108
11109 /**
11110 * @param {string} markup to use
11111 * @param {DOMElement} element root React element
11112 * @returns {boolean} whether or not the markup is the same
11113 */
11114 canReuseMarkup: function (markup, element) {
11115 var existingChecksum = element.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
11116 existingChecksum = existingChecksum && parseInt(existingChecksum, 10);
11117 var markupChecksum = adler32(markup);
11118 return markupChecksum === existingChecksum;
11119 }
11120};
11121
11122module.exports = ReactMarkupChecksum;
11123},{"116":116}],72:[function(_dereq_,module,exports){
11124/**
11125 * Copyright 2013-2015, Facebook, Inc.
11126 * All rights reserved.
11127 *
11128 * This source code is licensed under the BSD-style license found in the
11129 * LICENSE file in the root directory of this source tree. An additional grant
11130 * of patent rights can be found in the PATENTS file in the same directory.
11131 *
11132 * @providesModule ReactMount
11133 */
11134
11135'use strict';
11136
11137var DOMProperty = _dereq_(10);
11138var ReactBrowserEventEmitter = _dereq_(28);
11139var ReactCurrentOwner = _dereq_(39);
11140var ReactDOMFeatureFlags = _dereq_(44);
11141var ReactElement = _dereq_(57);
11142var ReactEmptyComponentRegistry = _dereq_(60);
11143var ReactInstanceHandles = _dereq_(67);
11144var ReactInstanceMap = _dereq_(68);
11145var ReactMarkupChecksum = _dereq_(71);
11146var ReactPerf = _dereq_(78);
11147var ReactReconciler = _dereq_(84);
11148var ReactUpdateQueue = _dereq_(95);
11149var ReactUpdates = _dereq_(96);
11150
11151var assign = _dereq_(24);
11152var emptyObject = _dereq_(154);
11153var containsNode = _dereq_(150);
11154var instantiateReactComponent = _dereq_(132);
11155var invariant = _dereq_(161);
11156var setInnerHTML = _dereq_(138);
11157var shouldUpdateReactComponent = _dereq_(141);
11158var validateDOMNesting = _dereq_(144);
11159var warning = _dereq_(173);
11160
11161var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
11162var nodeCache = {};
11163
11164var ELEMENT_NODE_TYPE = 1;
11165var DOC_NODE_TYPE = 9;
11166var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
11167
11168var ownerDocumentContextKey = '__ReactMount_ownerDocument$' + Math.random().toString(36).slice(2);
11169
11170/** Mapping from reactRootID to React component instance. */
11171var instancesByReactRootID = {};
11172
11173/** Mapping from reactRootID to `container` nodes. */
11174var containersByReactRootID = {};
11175
11176if ("development" !== 'production') {
11177 /** __DEV__-only mapping from reactRootID to root elements. */
11178 var rootElementsByReactRootID = {};
11179}
11180
11181// Used to store breadth-first search state in findComponentRoot.
11182var findComponentRootReusableArray = [];
11183
11184/**
11185 * Finds the index of the first character
11186 * that's not common between the two given strings.
11187 *
11188 * @return {number} the index of the character where the strings diverge
11189 */
11190function firstDifferenceIndex(string1, string2) {
11191 var minLen = Math.min(string1.length, string2.length);
11192 for (var i = 0; i < minLen; i++) {
11193 if (string1.charAt(i) !== string2.charAt(i)) {
11194 return i;
11195 }
11196 }
11197 return string1.length === string2.length ? -1 : minLen;
11198}
11199
11200/**
11201 * @param {DOMElement|DOMDocument} container DOM element that may contain
11202 * a React component
11203 * @return {?*} DOM element that may have the reactRoot ID, or null.
11204 */
11205function getReactRootElementInContainer(container) {
11206 if (!container) {
11207 return null;
11208 }
11209
11210 if (container.nodeType === DOC_NODE_TYPE) {
11211 return container.documentElement;
11212 } else {
11213 return container.firstChild;
11214 }
11215}
11216
11217/**
11218 * @param {DOMElement} container DOM element that may contain a React component.
11219 * @return {?string} A "reactRoot" ID, if a React component is rendered.
11220 */
11221function getReactRootID(container) {
11222 var rootElement = getReactRootElementInContainer(container);
11223 return rootElement && ReactMount.getID(rootElement);
11224}
11225
11226/**
11227 * Accessing node[ATTR_NAME] or calling getAttribute(ATTR_NAME) on a form
11228 * element can return its control whose name or ID equals ATTR_NAME. All
11229 * DOM nodes support `getAttributeNode` but this can also get called on
11230 * other objects so just return '' if we're given something other than a
11231 * DOM node (such as window).
11232 *
11233 * @param {?DOMElement|DOMWindow|DOMDocument|DOMTextNode} node DOM node.
11234 * @return {string} ID of the supplied `domNode`.
11235 */
11236function getID(node) {
11237 var id = internalGetID(node);
11238 if (id) {
11239 if (nodeCache.hasOwnProperty(id)) {
11240 var cached = nodeCache[id];
11241 if (cached !== node) {
11242 !!isValid(cached, id) ? "development" !== 'production' ? invariant(false, 'ReactMount: Two valid but unequal nodes with the same `%s`: %s', ATTR_NAME, id) : invariant(false) : undefined;
11243
11244 nodeCache[id] = node;
11245 }
11246 } else {
11247 nodeCache[id] = node;
11248 }
11249 }
11250
11251 return id;
11252}
11253
11254function internalGetID(node) {
11255 // If node is something like a window, document, or text node, none of
11256 // which support attributes or a .getAttribute method, gracefully return
11257 // the empty string, as if the attribute were missing.
11258 return node && node.getAttribute && node.getAttribute(ATTR_NAME) || '';
11259}
11260
11261/**
11262 * Sets the React-specific ID of the given node.
11263 *
11264 * @param {DOMElement} node The DOM node whose ID will be set.
11265 * @param {string} id The value of the ID attribute.
11266 */
11267function setID(node, id) {
11268 var oldID = internalGetID(node);
11269 if (oldID !== id) {
11270 delete nodeCache[oldID];
11271 }
11272 node.setAttribute(ATTR_NAME, id);
11273 nodeCache[id] = node;
11274}
11275
11276/**
11277 * Finds the node with the supplied React-generated DOM ID.
11278 *
11279 * @param {string} id A React-generated DOM ID.
11280 * @return {DOMElement} DOM node with the suppled `id`.
11281 * @internal
11282 */
11283function getNode(id) {
11284 if (!nodeCache.hasOwnProperty(id) || !isValid(nodeCache[id], id)) {
11285 nodeCache[id] = ReactMount.findReactNodeByID(id);
11286 }
11287 return nodeCache[id];
11288}
11289
11290/**
11291 * Finds the node with the supplied public React instance.
11292 *
11293 * @param {*} instance A public React instance.
11294 * @return {?DOMElement} DOM node with the suppled `id`.
11295 * @internal
11296 */
11297function getNodeFromInstance(instance) {
11298 var id = ReactInstanceMap.get(instance)._rootNodeID;
11299 if (ReactEmptyComponentRegistry.isNullComponentID(id)) {
11300 return null;
11301 }
11302 if (!nodeCache.hasOwnProperty(id) || !isValid(nodeCache[id], id)) {
11303 nodeCache[id] = ReactMount.findReactNodeByID(id);
11304 }
11305 return nodeCache[id];
11306}
11307
11308/**
11309 * A node is "valid" if it is contained by a currently mounted container.
11310 *
11311 * This means that the node does not have to be contained by a document in
11312 * order to be considered valid.
11313 *
11314 * @param {?DOMElement} node The candidate DOM node.
11315 * @param {string} id The expected ID of the node.
11316 * @return {boolean} Whether the node is contained by a mounted container.
11317 */
11318function isValid(node, id) {
11319 if (node) {
11320 !(internalGetID(node) === id) ? "development" !== 'production' ? invariant(false, 'ReactMount: Unexpected modification of `%s`', ATTR_NAME) : invariant(false) : undefined;
11321
11322 var container = ReactMount.findReactContainerForID(id);
11323 if (container && containsNode(container, node)) {
11324 return true;
11325 }
11326 }
11327
11328 return false;
11329}
11330
11331/**
11332 * Causes the cache to forget about one React-specific ID.
11333 *
11334 * @param {string} id The ID to forget.
11335 */
11336function purgeID(id) {
11337 delete nodeCache[id];
11338}
11339
11340var deepestNodeSoFar = null;
11341function findDeepestCachedAncestorImpl(ancestorID) {
11342 var ancestor = nodeCache[ancestorID];
11343 if (ancestor && isValid(ancestor, ancestorID)) {
11344 deepestNodeSoFar = ancestor;
11345 } else {
11346 // This node isn't populated in the cache, so presumably none of its
11347 // descendants are. Break out of the loop.
11348 return false;
11349 }
11350}
11351
11352/**
11353 * Return the deepest cached node whose ID is a prefix of `targetID`.
11354 */
11355function findDeepestCachedAncestor(targetID) {
11356 deepestNodeSoFar = null;
11357 ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);
11358
11359 var foundNode = deepestNodeSoFar;
11360 deepestNodeSoFar = null;
11361 return foundNode;
11362}
11363
11364/**
11365 * Mounts this component and inserts it into the DOM.
11366 *
11367 * @param {ReactComponent} componentInstance The instance to mount.
11368 * @param {string} rootID DOM ID of the root node.
11369 * @param {DOMElement} container DOM element to mount into.
11370 * @param {ReactReconcileTransaction} transaction
11371 * @param {boolean} shouldReuseMarkup If true, do not insert markup
11372 */
11373function mountComponentIntoNode(componentInstance, rootID, container, transaction, shouldReuseMarkup, context) {
11374 if (ReactDOMFeatureFlags.useCreateElement) {
11375 context = assign({}, context);
11376 if (container.nodeType === DOC_NODE_TYPE) {
11377 context[ownerDocumentContextKey] = container;
11378 } else {
11379 context[ownerDocumentContextKey] = container.ownerDocument;
11380 }
11381 }
11382 if ("development" !== 'production') {
11383 if (context === emptyObject) {
11384 context = {};
11385 }
11386 var tag = container.nodeName.toLowerCase();
11387 context[validateDOMNesting.ancestorInfoContextKey] = validateDOMNesting.updatedAncestorInfo(null, tag, null);
11388 }
11389 var markup = ReactReconciler.mountComponent(componentInstance, rootID, transaction, context);
11390 componentInstance._renderedComponent._topLevelWrapper = componentInstance;
11391 ReactMount._mountImageIntoNode(markup, container, shouldReuseMarkup, transaction);
11392}
11393
11394/**
11395 * Batched mount.
11396 *
11397 * @param {ReactComponent} componentInstance The instance to mount.
11398 * @param {string} rootID DOM ID of the root node.
11399 * @param {DOMElement} container DOM element to mount into.
11400 * @param {boolean} shouldReuseMarkup If true, do not insert markup
11401 */
11402function batchedMountComponentIntoNode(componentInstance, rootID, container, shouldReuseMarkup, context) {
11403 var transaction = ReactUpdates.ReactReconcileTransaction.getPooled(
11404 /* forceHTML */shouldReuseMarkup);
11405 transaction.perform(mountComponentIntoNode, null, componentInstance, rootID, container, transaction, shouldReuseMarkup, context);
11406 ReactUpdates.ReactReconcileTransaction.release(transaction);
11407}
11408
11409/**
11410 * Unmounts a component and removes it from the DOM.
11411 *
11412 * @param {ReactComponent} instance React component instance.
11413 * @param {DOMElement} container DOM element to unmount from.
11414 * @final
11415 * @internal
11416 * @see {ReactMount.unmountComponentAtNode}
11417 */
11418function unmountComponentFromNode(instance, container) {
11419 ReactReconciler.unmountComponent(instance);
11420
11421 if (container.nodeType === DOC_NODE_TYPE) {
11422 container = container.documentElement;
11423 }
11424
11425 // http://jsperf.com/emptying-a-node
11426 while (container.lastChild) {
11427 container.removeChild(container.lastChild);
11428 }
11429}
11430
11431/**
11432 * True if the supplied DOM node has a direct React-rendered child that is
11433 * not a React root element. Useful for warning in `render`,
11434 * `unmountComponentAtNode`, etc.
11435 *
11436 * @param {?DOMElement} node The candidate DOM node.
11437 * @return {boolean} True if the DOM element contains a direct child that was
11438 * rendered by React but is not a root element.
11439 * @internal
11440 */
11441function hasNonRootReactChild(node) {
11442 var reactRootID = getReactRootID(node);
11443 return reactRootID ? reactRootID !== ReactInstanceHandles.getReactRootIDFromNodeID(reactRootID) : false;
11444}
11445
11446/**
11447 * Returns the first (deepest) ancestor of a node which is rendered by this copy
11448 * of React.
11449 */
11450function findFirstReactDOMImpl(node) {
11451 // This node might be from another React instance, so we make sure not to
11452 // examine the node cache here
11453 for (; node && node.parentNode !== node; node = node.parentNode) {
11454 if (node.nodeType !== 1) {
11455 // Not a DOMElement, therefore not a React component
11456 continue;
11457 }
11458 var nodeID = internalGetID(node);
11459 if (!nodeID) {
11460 continue;
11461 }
11462 var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);
11463
11464 // If containersByReactRootID contains the container we find by crawling up
11465 // the tree, we know that this instance of React rendered the node.
11466 // nb. isValid's strategy (with containsNode) does not work because render
11467 // trees may be nested and we don't want a false positive in that case.
11468 var current = node;
11469 var lastID;
11470 do {
11471 lastID = internalGetID(current);
11472 current = current.parentNode;
11473 if (current == null) {
11474 // The passed-in node has been detached from the container it was
11475 // originally rendered into.
11476 return null;
11477 }
11478 } while (lastID !== reactRootID);
11479
11480 if (current === containersByReactRootID[reactRootID]) {
11481 return node;
11482 }
11483 }
11484 return null;
11485}
11486
11487/**
11488 * Temporary (?) hack so that we can store all top-level pending updates on
11489 * composites instead of having to worry about different types of components
11490 * here.
11491 */
11492var TopLevelWrapper = function () {};
11493TopLevelWrapper.prototype.isReactComponent = {};
11494if ("development" !== 'production') {
11495 TopLevelWrapper.displayName = 'TopLevelWrapper';
11496}
11497TopLevelWrapper.prototype.render = function () {
11498 // this.props is actually a ReactElement
11499 return this.props;
11500};
11501
11502/**
11503 * Mounting is the process of initializing a React component by creating its
11504 * representative DOM elements and inserting them into a supplied `container`.
11505 * Any prior content inside `container` is destroyed in the process.
11506 *
11507 * ReactMount.render(
11508 * component,
11509 * document.getElementById('container')
11510 * );
11511 *
11512 * <div id="container"> <-- Supplied `container`.
11513 * <div data-reactid=".3"> <-- Rendered reactRoot of React
11514 * // ... component.
11515 * </div>
11516 * </div>
11517 *
11518 * Inside of `container`, the first element rendered is the "reactRoot".
11519 */
11520var ReactMount = {
11521
11522 TopLevelWrapper: TopLevelWrapper,
11523
11524 /** Exposed for debugging purposes **/
11525 _instancesByReactRootID: instancesByReactRootID,
11526
11527 /**
11528 * This is a hook provided to support rendering React components while
11529 * ensuring that the apparent scroll position of its `container` does not
11530 * change.
11531 *
11532 * @param {DOMElement} container The `container` being rendered into.
11533 * @param {function} renderCallback This must be called once to do the render.
11534 */
11535 scrollMonitor: function (container, renderCallback) {
11536 renderCallback();
11537 },
11538
11539 /**
11540 * Take a component that's already mounted into the DOM and replace its props
11541 * @param {ReactComponent} prevComponent component instance already in the DOM
11542 * @param {ReactElement} nextElement component instance to render
11543 * @param {DOMElement} container container to render into
11544 * @param {?function} callback function triggered on completion
11545 */
11546 _updateRootComponent: function (prevComponent, nextElement, container, callback) {
11547 ReactMount.scrollMonitor(container, function () {
11548 ReactUpdateQueue.enqueueElementInternal(prevComponent, nextElement);
11549 if (callback) {
11550 ReactUpdateQueue.enqueueCallbackInternal(prevComponent, callback);
11551 }
11552 });
11553
11554 if ("development" !== 'production') {
11555 // Record the root element in case it later gets transplanted.
11556 rootElementsByReactRootID[getReactRootID(container)] = getReactRootElementInContainer(container);
11557 }
11558
11559 return prevComponent;
11560 },
11561
11562 /**
11563 * Register a component into the instance map and starts scroll value
11564 * monitoring
11565 * @param {ReactComponent} nextComponent component instance to render
11566 * @param {DOMElement} container container to render into
11567 * @return {string} reactRoot ID prefix
11568 */
11569 _registerComponent: function (nextComponent, container) {
11570 !(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? "development" !== 'production' ? invariant(false, '_registerComponent(...): Target container is not a DOM element.') : invariant(false) : undefined;
11571
11572 ReactBrowserEventEmitter.ensureScrollValueMonitoring();
11573
11574 var reactRootID = ReactMount.registerContainer(container);
11575 instancesByReactRootID[reactRootID] = nextComponent;
11576 return reactRootID;
11577 },
11578
11579 /**
11580 * Render a new component into the DOM.
11581 * @param {ReactElement} nextElement element to render
11582 * @param {DOMElement} container container to render into
11583 * @param {boolean} shouldReuseMarkup if we should skip the markup insertion
11584 * @return {ReactComponent} nextComponent
11585 */
11586 _renderNewRootComponent: function (nextElement, container, shouldReuseMarkup, context) {
11587 // Various parts of our code (such as ReactCompositeComponent's
11588 // _renderValidatedComponent) assume that calls to render aren't nested;
11589 // verify that that's the case.
11590 "development" !== 'production' ? warning(ReactCurrentOwner.current == null, '_renderNewRootComponent(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from ' + 'render is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : undefined;
11591
11592 var componentInstance = instantiateReactComponent(nextElement, null);
11593 var reactRootID = ReactMount._registerComponent(componentInstance, container);
11594
11595 // The initial render is synchronous but any updates that happen during
11596 // rendering, in componentWillMount or componentDidMount, will be batched
11597 // according to the current batching strategy.
11598
11599 ReactUpdates.batchedUpdates(batchedMountComponentIntoNode, componentInstance, reactRootID, container, shouldReuseMarkup, context);
11600
11601 if ("development" !== 'production') {
11602 // Record the root element in case it later gets transplanted.
11603 rootElementsByReactRootID[reactRootID] = getReactRootElementInContainer(container);
11604 }
11605
11606 return componentInstance;
11607 },
11608
11609 /**
11610 * Renders a React component into the DOM in the supplied `container`.
11611 *
11612 * If the React component was previously rendered into `container`, this will
11613 * perform an update on it and only mutate the DOM as necessary to reflect the
11614 * latest React component.
11615 *
11616 * @param {ReactComponent} parentComponent The conceptual parent of this render tree.
11617 * @param {ReactElement} nextElement Component element to render.
11618 * @param {DOMElement} container DOM element to render into.
11619 * @param {?function} callback function triggered on completion
11620 * @return {ReactComponent} Component instance rendered in `container`.
11621 */
11622 renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
11623 !(parentComponent != null && parentComponent._reactInternalInstance != null) ? "development" !== 'production' ? invariant(false, 'parentComponent must be a valid React Component') : invariant(false) : undefined;
11624 return ReactMount._renderSubtreeIntoContainer(parentComponent, nextElement, container, callback);
11625 },
11626
11627 _renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
11628 !ReactElement.isValidElement(nextElement) ? "development" !== 'production' ? invariant(false, 'ReactDOM.render(): Invalid component element.%s', typeof nextElement === 'string' ? ' Instead of passing an element string, make sure to instantiate ' + 'it by passing it to React.createElement.' : typeof nextElement === 'function' ? ' Instead of passing a component class, make sure to instantiate ' + 'it by passing it to React.createElement.' :
11629 // Check if it quacks like an element
11630 nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : invariant(false) : undefined;
11631
11632 "development" !== 'production' ? warning(!container || !container.tagName || container.tagName.toUpperCase() !== 'BODY', 'render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.') : undefined;
11633
11634 var nextWrappedElement = new ReactElement(TopLevelWrapper, null, null, null, null, null, nextElement);
11635
11636 var prevComponent = instancesByReactRootID[getReactRootID(container)];
11637
11638 if (prevComponent) {
11639 var prevWrappedElement = prevComponent._currentElement;
11640 var prevElement = prevWrappedElement.props;
11641 if (shouldUpdateReactComponent(prevElement, nextElement)) {
11642 var publicInst = prevComponent._renderedComponent.getPublicInstance();
11643 var updatedCallback = callback && function () {
11644 callback.call(publicInst);
11645 };
11646 ReactMount._updateRootComponent(prevComponent, nextWrappedElement, container, updatedCallback);
11647 return publicInst;
11648 } else {
11649 ReactMount.unmountComponentAtNode(container);
11650 }
11651 }
11652
11653 var reactRootElement = getReactRootElementInContainer(container);
11654 var containerHasReactMarkup = reactRootElement && !!internalGetID(reactRootElement);
11655 var containerHasNonRootReactChild = hasNonRootReactChild(container);
11656
11657 if ("development" !== 'production') {
11658 "development" !== 'production' ? warning(!containerHasNonRootReactChild, 'render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.') : undefined;
11659
11660 if (!containerHasReactMarkup || reactRootElement.nextSibling) {
11661 var rootElementSibling = reactRootElement;
11662 while (rootElementSibling) {
11663 if (internalGetID(rootElementSibling)) {
11664 "development" !== 'production' ? warning(false, 'render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.') : undefined;
11665 break;
11666 }
11667 rootElementSibling = rootElementSibling.nextSibling;
11668 }
11669 }
11670 }
11671
11672 var shouldReuseMarkup = containerHasReactMarkup && !prevComponent && !containerHasNonRootReactChild;
11673 var component = ReactMount._renderNewRootComponent(nextWrappedElement, container, shouldReuseMarkup, parentComponent != null ? parentComponent._reactInternalInstance._processChildContext(parentComponent._reactInternalInstance._context) : emptyObject)._renderedComponent.getPublicInstance();
11674 if (callback) {
11675 callback.call(component);
11676 }
11677 return component;
11678 },
11679
11680 /**
11681 * Renders a React component into the DOM in the supplied `container`.
11682 *
11683 * If the React component was previously rendered into `container`, this will
11684 * perform an update on it and only mutate the DOM as necessary to reflect the
11685 * latest React component.
11686 *
11687 * @param {ReactElement} nextElement Component element to render.
11688 * @param {DOMElement} container DOM element to render into.
11689 * @param {?function} callback function triggered on completion
11690 * @return {ReactComponent} Component instance rendered in `container`.
11691 */
11692 render: function (nextElement, container, callback) {
11693 return ReactMount._renderSubtreeIntoContainer(null, nextElement, container, callback);
11694 },
11695
11696 /**
11697 * Registers a container node into which React components will be rendered.
11698 * This also creates the "reactRoot" ID that will be assigned to the element
11699 * rendered within.
11700 *
11701 * @param {DOMElement} container DOM element to register as a container.
11702 * @return {string} The "reactRoot" ID of elements rendered within.
11703 */
11704 registerContainer: function (container) {
11705 var reactRootID = getReactRootID(container);
11706 if (reactRootID) {
11707 // If one exists, make sure it is a valid "reactRoot" ID.
11708 reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(reactRootID);
11709 }
11710 if (!reactRootID) {
11711 // No valid "reactRoot" ID found, create one.
11712 reactRootID = ReactInstanceHandles.createReactRootID();
11713 }
11714 containersByReactRootID[reactRootID] = container;
11715 return reactRootID;
11716 },
11717
11718 /**
11719 * Unmounts and destroys the React component rendered in the `container`.
11720 *
11721 * @param {DOMElement} container DOM element containing a React component.
11722 * @return {boolean} True if a component was found in and unmounted from
11723 * `container`
11724 */
11725 unmountComponentAtNode: function (container) {
11726 // Various parts of our code (such as ReactCompositeComponent's
11727 // _renderValidatedComponent) assume that calls to render aren't nested;
11728 // verify that that's the case. (Strictly speaking, unmounting won't cause a
11729 // render but we still don't expect to be in a render call here.)
11730 "development" !== 'production' ? warning(ReactCurrentOwner.current == null, 'unmountComponentAtNode(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from render ' + 'is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : undefined;
11731
11732 !(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? "development" !== 'production' ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : invariant(false) : undefined;
11733
11734 var reactRootID = getReactRootID(container);
11735 var component = instancesByReactRootID[reactRootID];
11736 if (!component) {
11737 // Check if the node being unmounted was rendered by React, but isn't a
11738 // root node.
11739 var containerHasNonRootReactChild = hasNonRootReactChild(container);
11740
11741 // Check if the container itself is a React root node.
11742 var containerID = internalGetID(container);
11743 var isContainerReactRoot = containerID && containerID === ReactInstanceHandles.getReactRootIDFromNodeID(containerID);
11744
11745 if ("development" !== 'production') {
11746 "development" !== 'production' ? warning(!containerHasNonRootReactChild, 'unmountComponentAtNode(): The node you\'re attempting to unmount ' + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.') : undefined;
11747 }
11748
11749 return false;
11750 }
11751 ReactUpdates.batchedUpdates(unmountComponentFromNode, component, container);
11752 delete instancesByReactRootID[reactRootID];
11753 delete containersByReactRootID[reactRootID];
11754 if ("development" !== 'production') {
11755 delete rootElementsByReactRootID[reactRootID];
11756 }
11757 return true;
11758 },
11759
11760 /**
11761 * Finds the container DOM element that contains React component to which the
11762 * supplied DOM `id` belongs.
11763 *
11764 * @param {string} id The ID of an element rendered by a React component.
11765 * @return {?DOMElement} DOM element that contains the `id`.
11766 */
11767 findReactContainerForID: function (id) {
11768 var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(id);
11769 var container = containersByReactRootID[reactRootID];
11770
11771 if ("development" !== 'production') {
11772 var rootElement = rootElementsByReactRootID[reactRootID];
11773 if (rootElement && rootElement.parentNode !== container) {
11774 "development" !== 'production' ? warning(
11775 // Call internalGetID here because getID calls isValid which calls
11776 // findReactContainerForID (this function).
11777 internalGetID(rootElement) === reactRootID, 'ReactMount: Root element ID differed from reactRootID.') : undefined;
11778 var containerChild = container.firstChild;
11779 if (containerChild && reactRootID === internalGetID(containerChild)) {
11780 // If the container has a new child with the same ID as the old
11781 // root element, then rootElementsByReactRootID[reactRootID] is
11782 // just stale and needs to be updated. The case that deserves a
11783 // warning is when the container is empty.
11784 rootElementsByReactRootID[reactRootID] = containerChild;
11785 } else {
11786 "development" !== 'production' ? warning(false, 'ReactMount: Root element has been removed from its original ' + 'container. New container: %s', rootElement.parentNode) : undefined;
11787 }
11788 }
11789 }
11790
11791 return container;
11792 },
11793
11794 /**
11795 * Finds an element rendered by React with the supplied ID.
11796 *
11797 * @param {string} id ID of a DOM node in the React component.
11798 * @return {DOMElement} Root DOM node of the React component.
11799 */
11800 findReactNodeByID: function (id) {
11801 var reactRoot = ReactMount.findReactContainerForID(id);
11802 return ReactMount.findComponentRoot(reactRoot, id);
11803 },
11804
11805 /**
11806 * Traverses up the ancestors of the supplied node to find a node that is a
11807 * DOM representation of a React component rendered by this copy of React.
11808 *
11809 * @param {*} node
11810 * @return {?DOMEventTarget}
11811 * @internal
11812 */
11813 getFirstReactDOM: function (node) {
11814 return findFirstReactDOMImpl(node);
11815 },
11816
11817 /**
11818 * Finds a node with the supplied `targetID` inside of the supplied
11819 * `ancestorNode`. Exploits the ID naming scheme to perform the search
11820 * quickly.
11821 *
11822 * @param {DOMEventTarget} ancestorNode Search from this root.
11823 * @pararm {string} targetID ID of the DOM representation of the component.
11824 * @return {DOMEventTarget} DOM node with the supplied `targetID`.
11825 * @internal
11826 */
11827 findComponentRoot: function (ancestorNode, targetID) {
11828 var firstChildren = findComponentRootReusableArray;
11829 var childIndex = 0;
11830
11831 var deepestAncestor = findDeepestCachedAncestor(targetID) || ancestorNode;
11832
11833 if ("development" !== 'production') {
11834 // This will throw on the next line; give an early warning
11835 "development" !== 'production' ? warning(deepestAncestor != null, 'React can\'t find the root component node for data-reactid value ' + '`%s`. If you\'re seeing this message, it probably means that ' + 'you\'ve loaded two copies of React on the page. At this time, only ' + 'a single copy of React can be loaded at a time.', targetID) : undefined;
11836 }
11837
11838 firstChildren[0] = deepestAncestor.firstChild;
11839 firstChildren.length = 1;
11840
11841 while (childIndex < firstChildren.length) {
11842 var child = firstChildren[childIndex++];
11843 var targetChild;
11844
11845 while (child) {
11846 var childID = ReactMount.getID(child);
11847 if (childID) {
11848 // Even if we find the node we're looking for, we finish looping
11849 // through its siblings to ensure they're cached so that we don't have
11850 // to revisit this node again. Otherwise, we make n^2 calls to getID
11851 // when visiting the many children of a single node in order.
11852
11853 if (targetID === childID) {
11854 targetChild = child;
11855 } else if (ReactInstanceHandles.isAncestorIDOf(childID, targetID)) {
11856 // If we find a child whose ID is an ancestor of the given ID,
11857 // then we can be sure that we only want to search the subtree
11858 // rooted at this child, so we can throw out the rest of the
11859 // search state.
11860 firstChildren.length = childIndex = 0;
11861 firstChildren.push(child.firstChild);
11862 }
11863 } else {
11864 // If this child had no ID, then there's a chance that it was
11865 // injected automatically by the browser, as when a `<table>`
11866 // element sprouts an extra `<tbody>` child as a side effect of
11867 // `.innerHTML` parsing. Optimistically continue down this
11868 // branch, but not before examining the other siblings.
11869 firstChildren.push(child.firstChild);
11870 }
11871
11872 child = child.nextSibling;
11873 }
11874
11875 if (targetChild) {
11876 // Emptying firstChildren/findComponentRootReusableArray is
11877 // not necessary for correctness, but it helps the GC reclaim
11878 // any nodes that were left at the end of the search.
11879 firstChildren.length = 0;
11880
11881 return targetChild;
11882 }
11883 }
11884
11885 firstChildren.length = 0;
11886
11887 !false ? "development" !== 'production' ? invariant(false, 'findComponentRoot(..., %s): Unable to find element. This probably ' + 'means the DOM was unexpectedly mutated (e.g., by the browser), ' + 'usually due to forgetting a <tbody> when using tables, nesting tags ' + 'like <form>, <p>, or <a>, or using non-SVG elements in an <svg> ' + 'parent. ' + 'Try inspecting the child nodes of the element with React ID `%s`.', targetID, ReactMount.getID(ancestorNode)) : invariant(false) : undefined;
11888 },
11889
11890 _mountImageIntoNode: function (markup, container, shouldReuseMarkup, transaction) {
11891 !(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? "development" !== 'production' ? invariant(false, 'mountComponentIntoNode(...): Target container is not valid.') : invariant(false) : undefined;
11892
11893 if (shouldReuseMarkup) {
11894 var rootElement = getReactRootElementInContainer(container);
11895 if (ReactMarkupChecksum.canReuseMarkup(markup, rootElement)) {
11896 return;
11897 } else {
11898 var checksum = rootElement.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
11899 rootElement.removeAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
11900
11901 var rootMarkup = rootElement.outerHTML;
11902 rootElement.setAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME, checksum);
11903
11904 var normalizedMarkup = markup;
11905 if ("development" !== 'production') {
11906 // because rootMarkup is retrieved from the DOM, various normalizations
11907 // will have occurred which will not be present in `markup`. Here,
11908 // insert markup into a <div> or <iframe> depending on the container
11909 // type to perform the same normalizations before comparing.
11910 var normalizer;
11911 if (container.nodeType === ELEMENT_NODE_TYPE) {
11912 normalizer = document.createElement('div');
11913 normalizer.innerHTML = markup;
11914 normalizedMarkup = normalizer.innerHTML;
11915 } else {
11916 normalizer = document.createElement('iframe');
11917 document.body.appendChild(normalizer);
11918 normalizer.contentDocument.write(markup);
11919 normalizedMarkup = normalizer.contentDocument.documentElement.outerHTML;
11920 document.body.removeChild(normalizer);
11921 }
11922 }
11923
11924 var diffIndex = firstDifferenceIndex(normalizedMarkup, rootMarkup);
11925 var difference = ' (client) ' + normalizedMarkup.substring(diffIndex - 20, diffIndex + 20) + '\n (server) ' + rootMarkup.substring(diffIndex - 20, diffIndex + 20);
11926
11927 !(container.nodeType !== DOC_NODE_TYPE) ? "development" !== 'production' ? invariant(false, 'You\'re trying to render a component to the document using ' + 'server rendering but the checksum was invalid. This usually ' + 'means you rendered a different component type or props on ' + 'the client from the one on the server, or your render() ' + 'methods are impure. React cannot handle this case due to ' + 'cross-browser quirks by rendering at the document root. You ' + 'should look for environment dependent code in your components ' + 'and ensure the props are the same client and server side:\n%s', difference) : invariant(false) : undefined;
11928
11929 if ("development" !== 'production') {
11930 "development" !== 'production' ? warning(false, 'React attempted to reuse markup in a container but the ' + 'checksum was invalid. This generally means that you are ' + 'using server rendering and the markup generated on the ' + 'server was not what the client was expecting. React injected ' + 'new markup to compensate which works but you have lost many ' + 'of the benefits of server rendering. Instead, figure out ' + 'why the markup being generated is different on the client ' + 'or server:\n%s', difference) : undefined;
11931 }
11932 }
11933 }
11934
11935 !(container.nodeType !== DOC_NODE_TYPE) ? "development" !== 'production' ? invariant(false, 'You\'re trying to render a component to the document but ' + 'you didn\'t use server rendering. We can\'t do this ' + 'without using server rendering due to cross-browser quirks. ' + 'See ReactDOMServer.renderToString() for server rendering.') : invariant(false) : undefined;
11936
11937 if (transaction.useCreateElement) {
11938 while (container.lastChild) {
11939 container.removeChild(container.lastChild);
11940 }
11941 container.appendChild(markup);
11942 } else {
11943 setInnerHTML(container, markup);
11944 }
11945 },
11946
11947 ownerDocumentContextKey: ownerDocumentContextKey,
11948
11949 /**
11950 * React ID utilities.
11951 */
11952
11953 getReactRootID: getReactRootID,
11954
11955 getID: getID,
11956
11957 setID: setID,
11958
11959 getNode: getNode,
11960
11961 getNodeFromInstance: getNodeFromInstance,
11962
11963 isValid: isValid,
11964
11965 purgeID: purgeID
11966};
11967
11968ReactPerf.measureMethods(ReactMount, 'ReactMount', {
11969 _renderNewRootComponent: '_renderNewRootComponent',
11970 _mountImageIntoNode: '_mountImageIntoNode'
11971});
11972
11973module.exports = ReactMount;
11974},{"10":10,"132":132,"138":138,"141":141,"144":144,"150":150,"154":154,"161":161,"173":173,"24":24,"28":28,"39":39,"44":44,"57":57,"60":60,"67":67,"68":68,"71":71,"78":78,"84":84,"95":95,"96":96}],73:[function(_dereq_,module,exports){
11975/**
11976 * Copyright 2013-2015, Facebook, Inc.
11977 * All rights reserved.
11978 *
11979 * This source code is licensed under the BSD-style license found in the
11980 * LICENSE file in the root directory of this source tree. An additional grant
11981 * of patent rights can be found in the PATENTS file in the same directory.
11982 *
11983 * @providesModule ReactMultiChild
11984 * @typechecks static-only
11985 */
11986
11987'use strict';
11988
11989var ReactComponentEnvironment = _dereq_(36);
11990var ReactMultiChildUpdateTypes = _dereq_(74);
11991
11992var ReactCurrentOwner = _dereq_(39);
11993var ReactReconciler = _dereq_(84);
11994var ReactChildReconciler = _dereq_(31);
11995
11996var flattenChildren = _dereq_(123);
11997
11998/**
11999 * Updating children of a component may trigger recursive updates. The depth is
12000 * used to batch recursive updates to render markup more efficiently.
12001 *
12002 * @type {number}
12003 * @private
12004 */
12005var updateDepth = 0;
12006
12007/**
12008 * Queue of update configuration objects.
12009 *
12010 * Each object has a `type` property that is in `ReactMultiChildUpdateTypes`.
12011 *
12012 * @type {array<object>}
12013 * @private
12014 */
12015var updateQueue = [];
12016
12017/**
12018 * Queue of markup to be rendered.
12019 *
12020 * @type {array<string>}
12021 * @private
12022 */
12023var markupQueue = [];
12024
12025/**
12026 * Enqueues markup to be rendered and inserted at a supplied index.
12027 *
12028 * @param {string} parentID ID of the parent component.
12029 * @param {string} markup Markup that renders into an element.
12030 * @param {number} toIndex Destination index.
12031 * @private
12032 */
12033function enqueueInsertMarkup(parentID, markup, toIndex) {
12034 // NOTE: Null values reduce hidden classes.
12035 updateQueue.push({
12036 parentID: parentID,
12037 parentNode: null,
12038 type: ReactMultiChildUpdateTypes.INSERT_MARKUP,
12039 markupIndex: markupQueue.push(markup) - 1,
12040 content: null,
12041 fromIndex: null,
12042 toIndex: toIndex
12043 });
12044}
12045
12046/**
12047 * Enqueues moving an existing element to another index.
12048 *
12049 * @param {string} parentID ID of the parent component.
12050 * @param {number} fromIndex Source index of the existing element.
12051 * @param {number} toIndex Destination index of the element.
12052 * @private
12053 */
12054function enqueueMove(parentID, fromIndex, toIndex) {
12055 // NOTE: Null values reduce hidden classes.
12056 updateQueue.push({
12057 parentID: parentID,
12058 parentNode: null,
12059 type: ReactMultiChildUpdateTypes.MOVE_EXISTING,
12060 markupIndex: null,
12061 content: null,
12062 fromIndex: fromIndex,
12063 toIndex: toIndex
12064 });
12065}
12066
12067/**
12068 * Enqueues removing an element at an index.
12069 *
12070 * @param {string} parentID ID of the parent component.
12071 * @param {number} fromIndex Index of the element to remove.
12072 * @private
12073 */
12074function enqueueRemove(parentID, fromIndex) {
12075 // NOTE: Null values reduce hidden classes.
12076 updateQueue.push({
12077 parentID: parentID,
12078 parentNode: null,
12079 type: ReactMultiChildUpdateTypes.REMOVE_NODE,
12080 markupIndex: null,
12081 content: null,
12082 fromIndex: fromIndex,
12083 toIndex: null
12084 });
12085}
12086
12087/**
12088 * Enqueues setting the markup of a node.
12089 *
12090 * @param {string} parentID ID of the parent component.
12091 * @param {string} markup Markup that renders into an element.
12092 * @private
12093 */
12094function enqueueSetMarkup(parentID, markup) {
12095 // NOTE: Null values reduce hidden classes.
12096 updateQueue.push({
12097 parentID: parentID,
12098 parentNode: null,
12099 type: ReactMultiChildUpdateTypes.SET_MARKUP,
12100 markupIndex: null,
12101 content: markup,
12102 fromIndex: null,
12103 toIndex: null
12104 });
12105}
12106
12107/**
12108 * Enqueues setting the text content.
12109 *
12110 * @param {string} parentID ID of the parent component.
12111 * @param {string} textContent Text content to set.
12112 * @private
12113 */
12114function enqueueTextContent(parentID, textContent) {
12115 // NOTE: Null values reduce hidden classes.
12116 updateQueue.push({
12117 parentID: parentID,
12118 parentNode: null,
12119 type: ReactMultiChildUpdateTypes.TEXT_CONTENT,
12120 markupIndex: null,
12121 content: textContent,
12122 fromIndex: null,
12123 toIndex: null
12124 });
12125}
12126
12127/**
12128 * Processes any enqueued updates.
12129 *
12130 * @private
12131 */
12132function processQueue() {
12133 if (updateQueue.length) {
12134 ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);
12135 clearQueue();
12136 }
12137}
12138
12139/**
12140 * Clears any enqueued updates.
12141 *
12142 * @private
12143 */
12144function clearQueue() {
12145 updateQueue.length = 0;
12146 markupQueue.length = 0;
12147}
12148
12149/**
12150 * ReactMultiChild are capable of reconciling multiple children.
12151 *
12152 * @class ReactMultiChild
12153 * @internal
12154 */
12155var ReactMultiChild = {
12156
12157 /**
12158 * Provides common functionality for components that must reconcile multiple
12159 * children. This is used by `ReactDOMComponent` to mount, update, and
12160 * unmount child components.
12161 *
12162 * @lends {ReactMultiChild.prototype}
12163 */
12164 Mixin: {
12165
12166 _reconcilerInstantiateChildren: function (nestedChildren, transaction, context) {
12167 if ("development" !== 'production') {
12168 if (this._currentElement) {
12169 try {
12170 ReactCurrentOwner.current = this._currentElement._owner;
12171 return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context);
12172 } finally {
12173 ReactCurrentOwner.current = null;
12174 }
12175 }
12176 }
12177 return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context);
12178 },
12179
12180 _reconcilerUpdateChildren: function (prevChildren, nextNestedChildrenElements, transaction, context) {
12181 var nextChildren;
12182 if ("development" !== 'production') {
12183 if (this._currentElement) {
12184 try {
12185 ReactCurrentOwner.current = this._currentElement._owner;
12186 nextChildren = flattenChildren(nextNestedChildrenElements);
12187 } finally {
12188 ReactCurrentOwner.current = null;
12189 }
12190 return ReactChildReconciler.updateChildren(prevChildren, nextChildren, transaction, context);
12191 }
12192 }
12193 nextChildren = flattenChildren(nextNestedChildrenElements);
12194 return ReactChildReconciler.updateChildren(prevChildren, nextChildren, transaction, context);
12195 },
12196
12197 /**
12198 * Generates a "mount image" for each of the supplied children. In the case
12199 * of `ReactDOMComponent`, a mount image is a string of markup.
12200 *
12201 * @param {?object} nestedChildren Nested child maps.
12202 * @return {array} An array of mounted representations.
12203 * @internal
12204 */
12205 mountChildren: function (nestedChildren, transaction, context) {
12206 var children = this._reconcilerInstantiateChildren(nestedChildren, transaction, context);
12207 this._renderedChildren = children;
12208 var mountImages = [];
12209 var index = 0;
12210 for (var name in children) {
12211 if (children.hasOwnProperty(name)) {
12212 var child = children[name];
12213 // Inlined for performance, see `ReactInstanceHandles.createReactID`.
12214 var rootID = this._rootNodeID + name;
12215 var mountImage = ReactReconciler.mountComponent(child, rootID, transaction, context);
12216 child._mountIndex = index++;
12217 mountImages.push(mountImage);
12218 }
12219 }
12220 return mountImages;
12221 },
12222
12223 /**
12224 * Replaces any rendered children with a text content string.
12225 *
12226 * @param {string} nextContent String of content.
12227 * @internal
12228 */
12229 updateTextContent: function (nextContent) {
12230 updateDepth++;
12231 var errorThrown = true;
12232 try {
12233 var prevChildren = this._renderedChildren;
12234 // Remove any rendered children.
12235 ReactChildReconciler.unmountChildren(prevChildren);
12236 // TODO: The setTextContent operation should be enough
12237 for (var name in prevChildren) {
12238 if (prevChildren.hasOwnProperty(name)) {
12239 this._unmountChild(prevChildren[name]);
12240 }
12241 }
12242 // Set new text content.
12243 this.setTextContent(nextContent);
12244 errorThrown = false;
12245 } finally {
12246 updateDepth--;
12247 if (!updateDepth) {
12248 if (errorThrown) {
12249 clearQueue();
12250 } else {
12251 processQueue();
12252 }
12253 }
12254 }
12255 },
12256
12257 /**
12258 * Replaces any rendered children with a markup string.
12259 *
12260 * @param {string} nextMarkup String of markup.
12261 * @internal
12262 */
12263 updateMarkup: function (nextMarkup) {
12264 updateDepth++;
12265 var errorThrown = true;
12266 try {
12267 var prevChildren = this._renderedChildren;
12268 // Remove any rendered children.
12269 ReactChildReconciler.unmountChildren(prevChildren);
12270 for (var name in prevChildren) {
12271 if (prevChildren.hasOwnProperty(name)) {
12272 this._unmountChildByName(prevChildren[name], name);
12273 }
12274 }
12275 this.setMarkup(nextMarkup);
12276 errorThrown = false;
12277 } finally {
12278 updateDepth--;
12279 if (!updateDepth) {
12280 if (errorThrown) {
12281 clearQueue();
12282 } else {
12283 processQueue();
12284 }
12285 }
12286 }
12287 },
12288
12289 /**
12290 * Updates the rendered children with new children.
12291 *
12292 * @param {?object} nextNestedChildrenElements Nested child element maps.
12293 * @param {ReactReconcileTransaction} transaction
12294 * @internal
12295 */
12296 updateChildren: function (nextNestedChildrenElements, transaction, context) {
12297 updateDepth++;
12298 var errorThrown = true;
12299 try {
12300 this._updateChildren(nextNestedChildrenElements, transaction, context);
12301 errorThrown = false;
12302 } finally {
12303 updateDepth--;
12304 if (!updateDepth) {
12305 if (errorThrown) {
12306 clearQueue();
12307 } else {
12308 processQueue();
12309 }
12310 }
12311 }
12312 },
12313
12314 /**
12315 * Improve performance by isolating this hot code path from the try/catch
12316 * block in `updateChildren`.
12317 *
12318 * @param {?object} nextNestedChildrenElements Nested child element maps.
12319 * @param {ReactReconcileTransaction} transaction
12320 * @final
12321 * @protected
12322 */
12323 _updateChildren: function (nextNestedChildrenElements, transaction, context) {
12324 var prevChildren = this._renderedChildren;
12325 var nextChildren = this._reconcilerUpdateChildren(prevChildren, nextNestedChildrenElements, transaction, context);
12326 this._renderedChildren = nextChildren;
12327 if (!nextChildren && !prevChildren) {
12328 return;
12329 }
12330 var name;
12331 // `nextIndex` will increment for each child in `nextChildren`, but
12332 // `lastIndex` will be the last index visited in `prevChildren`.
12333 var lastIndex = 0;
12334 var nextIndex = 0;
12335 for (name in nextChildren) {
12336 if (!nextChildren.hasOwnProperty(name)) {
12337 continue;
12338 }
12339 var prevChild = prevChildren && prevChildren[name];
12340 var nextChild = nextChildren[name];
12341 if (prevChild === nextChild) {
12342 this.moveChild(prevChild, nextIndex, lastIndex);
12343 lastIndex = Math.max(prevChild._mountIndex, lastIndex);
12344 prevChild._mountIndex = nextIndex;
12345 } else {
12346 if (prevChild) {
12347 // Update `lastIndex` before `_mountIndex` gets unset by unmounting.
12348 lastIndex = Math.max(prevChild._mountIndex, lastIndex);
12349 this._unmountChild(prevChild);
12350 }
12351 // The child must be instantiated before it's mounted.
12352 this._mountChildByNameAtIndex(nextChild, name, nextIndex, transaction, context);
12353 }
12354 nextIndex++;
12355 }
12356 // Remove children that are no longer present.
12357 for (name in prevChildren) {
12358 if (prevChildren.hasOwnProperty(name) && !(nextChildren && nextChildren.hasOwnProperty(name))) {
12359 this._unmountChild(prevChildren[name]);
12360 }
12361 }
12362 },
12363
12364 /**
12365 * Unmounts all rendered children. This should be used to clean up children
12366 * when this component is unmounted.
12367 *
12368 * @internal
12369 */
12370 unmountChildren: function () {
12371 var renderedChildren = this._renderedChildren;
12372 ReactChildReconciler.unmountChildren(renderedChildren);
12373 this._renderedChildren = null;
12374 },
12375
12376 /**
12377 * Moves a child component to the supplied index.
12378 *
12379 * @param {ReactComponent} child Component to move.
12380 * @param {number} toIndex Destination index of the element.
12381 * @param {number} lastIndex Last index visited of the siblings of `child`.
12382 * @protected
12383 */
12384 moveChild: function (child, toIndex, lastIndex) {
12385 // If the index of `child` is less than `lastIndex`, then it needs to
12386 // be moved. Otherwise, we do not need to move it because a child will be
12387 // inserted or moved before `child`.
12388 if (child._mountIndex < lastIndex) {
12389 enqueueMove(this._rootNodeID, child._mountIndex, toIndex);
12390 }
12391 },
12392
12393 /**
12394 * Creates a child component.
12395 *
12396 * @param {ReactComponent} child Component to create.
12397 * @param {string} mountImage Markup to insert.
12398 * @protected
12399 */
12400 createChild: function (child, mountImage) {
12401 enqueueInsertMarkup(this._rootNodeID, mountImage, child._mountIndex);
12402 },
12403
12404 /**
12405 * Removes a child component.
12406 *
12407 * @param {ReactComponent} child Child to remove.
12408 * @protected
12409 */
12410 removeChild: function (child) {
12411 enqueueRemove(this._rootNodeID, child._mountIndex);
12412 },
12413
12414 /**
12415 * Sets this text content string.
12416 *
12417 * @param {string} textContent Text content to set.
12418 * @protected
12419 */
12420 setTextContent: function (textContent) {
12421 enqueueTextContent(this._rootNodeID, textContent);
12422 },
12423
12424 /**
12425 * Sets this markup string.
12426 *
12427 * @param {string} markup Markup to set.
12428 * @protected
12429 */
12430 setMarkup: function (markup) {
12431 enqueueSetMarkup(this._rootNodeID, markup);
12432 },
12433
12434 /**
12435 * Mounts a child with the supplied name.
12436 *
12437 * NOTE: This is part of `updateChildren` and is here for readability.
12438 *
12439 * @param {ReactComponent} child Component to mount.
12440 * @param {string} name Name of the child.
12441 * @param {number} index Index at which to insert the child.
12442 * @param {ReactReconcileTransaction} transaction
12443 * @private
12444 */
12445 _mountChildByNameAtIndex: function (child, name, index, transaction, context) {
12446 // Inlined for performance, see `ReactInstanceHandles.createReactID`.
12447 var rootID = this._rootNodeID + name;
12448 var mountImage = ReactReconciler.mountComponent(child, rootID, transaction, context);
12449 child._mountIndex = index;
12450 this.createChild(child, mountImage);
12451 },
12452
12453 /**
12454 * Unmounts a rendered child.
12455 *
12456 * NOTE: This is part of `updateChildren` and is here for readability.
12457 *
12458 * @param {ReactComponent} child Component to unmount.
12459 * @private
12460 */
12461 _unmountChild: function (child) {
12462 this.removeChild(child);
12463 child._mountIndex = null;
12464 }
12465
12466 }
12467
12468};
12469
12470module.exports = ReactMultiChild;
12471},{"123":123,"31":31,"36":36,"39":39,"74":74,"84":84}],74:[function(_dereq_,module,exports){
12472/**
12473 * Copyright 2013-2015, Facebook, Inc.
12474 * All rights reserved.
12475 *
12476 * This source code is licensed under the BSD-style license found in the
12477 * LICENSE file in the root directory of this source tree. An additional grant
12478 * of patent rights can be found in the PATENTS file in the same directory.
12479 *
12480 * @providesModule ReactMultiChildUpdateTypes
12481 */
12482
12483'use strict';
12484
12485var keyMirror = _dereq_(165);
12486
12487/**
12488 * When a component's children are updated, a series of update configuration
12489 * objects are created in order to batch and serialize the required changes.
12490 *
12491 * Enumerates all the possible types of update configurations.
12492 *
12493 * @internal
12494 */
12495var ReactMultiChildUpdateTypes = keyMirror({
12496 INSERT_MARKUP: null,
12497 MOVE_EXISTING: null,
12498 REMOVE_NODE: null,
12499 SET_MARKUP: null,
12500 TEXT_CONTENT: null
12501});
12502
12503module.exports = ReactMultiChildUpdateTypes;
12504},{"165":165}],75:[function(_dereq_,module,exports){
12505/**
12506 * Copyright 2014-2015, Facebook, Inc.
12507 * All rights reserved.
12508 *
12509 * This source code is licensed under the BSD-style license found in the
12510 * LICENSE file in the root directory of this source tree. An additional grant
12511 * of patent rights can be found in the PATENTS file in the same directory.
12512 *
12513 * @providesModule ReactNativeComponent
12514 */
12515
12516'use strict';
12517
12518var assign = _dereq_(24);
12519var invariant = _dereq_(161);
12520
12521var autoGenerateWrapperClass = null;
12522var genericComponentClass = null;
12523// This registry keeps track of wrapper classes around native tags.
12524var tagToComponentClass = {};
12525var textComponentClass = null;
12526
12527var ReactNativeComponentInjection = {
12528 // This accepts a class that receives the tag string. This is a catch all
12529 // that can render any kind of tag.
12530 injectGenericComponentClass: function (componentClass) {
12531 genericComponentClass = componentClass;
12532 },
12533 // This accepts a text component class that takes the text string to be
12534 // rendered as props.
12535 injectTextComponentClass: function (componentClass) {
12536 textComponentClass = componentClass;
12537 },
12538 // This accepts a keyed object with classes as values. Each key represents a
12539 // tag. That particular tag will use this class instead of the generic one.
12540 injectComponentClasses: function (componentClasses) {
12541 assign(tagToComponentClass, componentClasses);
12542 }
12543};
12544
12545/**
12546 * Get a composite component wrapper class for a specific tag.
12547 *
12548 * @param {ReactElement} element The tag for which to get the class.
12549 * @return {function} The React class constructor function.
12550 */
12551function getComponentClassForElement(element) {
12552 if (typeof element.type === 'function') {
12553 return element.type;
12554 }
12555 var tag = element.type;
12556 var componentClass = tagToComponentClass[tag];
12557 if (componentClass == null) {
12558 tagToComponentClass[tag] = componentClass = autoGenerateWrapperClass(tag);
12559 }
12560 return componentClass;
12561}
12562
12563/**
12564 * Get a native internal component class for a specific tag.
12565 *
12566 * @param {ReactElement} element The element to create.
12567 * @return {function} The internal class constructor function.
12568 */
12569function createInternalComponent(element) {
12570 !genericComponentClass ? "development" !== 'production' ? invariant(false, 'There is no registered component for the tag %s', element.type) : invariant(false) : undefined;
12571 return new genericComponentClass(element.type, element.props);
12572}
12573
12574/**
12575 * @param {ReactText} text
12576 * @return {ReactComponent}
12577 */
12578function createInstanceForText(text) {
12579 return new textComponentClass(text);
12580}
12581
12582/**
12583 * @param {ReactComponent} component
12584 * @return {boolean}
12585 */
12586function isTextComponent(component) {
12587 return component instanceof textComponentClass;
12588}
12589
12590var ReactNativeComponent = {
12591 getComponentClassForElement: getComponentClassForElement,
12592 createInternalComponent: createInternalComponent,
12593 createInstanceForText: createInstanceForText,
12594 isTextComponent: isTextComponent,
12595 injection: ReactNativeComponentInjection
12596};
12597
12598module.exports = ReactNativeComponent;
12599},{"161":161,"24":24}],76:[function(_dereq_,module,exports){
12600/**
12601 * Copyright 2015, Facebook, Inc.
12602 * All rights reserved.
12603 *
12604 * This source code is licensed under the BSD-style license found in the
12605 * LICENSE file in the root directory of this source tree. An additional grant
12606 * of patent rights can be found in the PATENTS file in the same directory.
12607 *
12608 * @providesModule ReactNoopUpdateQueue
12609 */
12610
12611'use strict';
12612
12613var warning = _dereq_(173);
12614
12615function warnTDZ(publicInstance, callerName) {
12616 if ("development" !== 'production') {
12617 "development" !== 'production' ? warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, publicInstance.constructor && publicInstance.constructor.displayName || '') : undefined;
12618 }
12619}
12620
12621/**
12622 * This is the abstract API for an update queue.
12623 */
12624var ReactNoopUpdateQueue = {
12625
12626 /**
12627 * Checks whether or not this composite component is mounted.
12628 * @param {ReactClass} publicInstance The instance we want to test.
12629 * @return {boolean} True if mounted, false otherwise.
12630 * @protected
12631 * @final
12632 */
12633 isMounted: function (publicInstance) {
12634 return false;
12635 },
12636
12637 /**
12638 * Enqueue a callback that will be executed after all the pending updates
12639 * have processed.
12640 *
12641 * @param {ReactClass} publicInstance The instance to use as `this` context.
12642 * @param {?function} callback Called after state is updated.
12643 * @internal
12644 */
12645 enqueueCallback: function (publicInstance, callback) {},
12646
12647 /**
12648 * Forces an update. This should only be invoked when it is known with
12649 * certainty that we are **not** in a DOM transaction.
12650 *
12651 * You may want to call this when you know that some deeper aspect of the
12652 * component's state has changed but `setState` was not called.
12653 *
12654 * This will not invoke `shouldComponentUpdate`, but it will invoke
12655 * `componentWillUpdate` and `componentDidUpdate`.
12656 *
12657 * @param {ReactClass} publicInstance The instance that should rerender.
12658 * @internal
12659 */
12660 enqueueForceUpdate: function (publicInstance) {
12661 warnTDZ(publicInstance, 'forceUpdate');
12662 },
12663
12664 /**
12665 * Replaces all of the state. Always use this or `setState` to mutate state.
12666 * You should treat `this.state` as immutable.
12667 *
12668 * There is no guarantee that `this.state` will be immediately updated, so
12669 * accessing `this.state` after calling this method may return the old value.
12670 *
12671 * @param {ReactClass} publicInstance The instance that should rerender.
12672 * @param {object} completeState Next state.
12673 * @internal
12674 */
12675 enqueueReplaceState: function (publicInstance, completeState) {
12676 warnTDZ(publicInstance, 'replaceState');
12677 },
12678
12679 /**
12680 * Sets a subset of the state. This only exists because _pendingState is
12681 * internal. This provides a merging strategy that is not available to deep
12682 * properties which is confusing. TODO: Expose pendingState or don't use it
12683 * during the merge.
12684 *
12685 * @param {ReactClass} publicInstance The instance that should rerender.
12686 * @param {object} partialState Next partial state to be merged with state.
12687 * @internal
12688 */
12689 enqueueSetState: function (publicInstance, partialState) {
12690 warnTDZ(publicInstance, 'setState');
12691 },
12692
12693 /**
12694 * Sets a subset of the props.
12695 *
12696 * @param {ReactClass} publicInstance The instance that should rerender.
12697 * @param {object} partialProps Subset of the next props.
12698 * @internal
12699 */
12700 enqueueSetProps: function (publicInstance, partialProps) {
12701 warnTDZ(publicInstance, 'setProps');
12702 },
12703
12704 /**
12705 * Replaces all of the props.
12706 *
12707 * @param {ReactClass} publicInstance The instance that should rerender.
12708 * @param {object} props New props.
12709 * @internal
12710 */
12711 enqueueReplaceProps: function (publicInstance, props) {
12712 warnTDZ(publicInstance, 'replaceProps');
12713 }
12714
12715};
12716
12717module.exports = ReactNoopUpdateQueue;
12718},{"173":173}],77:[function(_dereq_,module,exports){
12719/**
12720 * Copyright 2013-2015, Facebook, Inc.
12721 * All rights reserved.
12722 *
12723 * This source code is licensed under the BSD-style license found in the
12724 * LICENSE file in the root directory of this source tree. An additional grant
12725 * of patent rights can be found in the PATENTS file in the same directory.
12726 *
12727 * @providesModule ReactOwner
12728 */
12729
12730'use strict';
12731
12732var invariant = _dereq_(161);
12733
12734/**
12735 * ReactOwners are capable of storing references to owned components.
12736 *
12737 * All components are capable of //being// referenced by owner components, but
12738 * only ReactOwner components are capable of //referencing// owned components.
12739 * The named reference is known as a "ref".
12740 *
12741 * Refs are available when mounted and updated during reconciliation.
12742 *
12743 * var MyComponent = React.createClass({
12744 * render: function() {
12745 * return (
12746 * <div onClick={this.handleClick}>
12747 * <CustomComponent ref="custom" />
12748 * </div>
12749 * );
12750 * },
12751 * handleClick: function() {
12752 * this.refs.custom.handleClick();
12753 * },
12754 * componentDidMount: function() {
12755 * this.refs.custom.initialize();
12756 * }
12757 * });
12758 *
12759 * Refs should rarely be used. When refs are used, they should only be done to
12760 * control data that is not handled by React's data flow.
12761 *
12762 * @class ReactOwner
12763 */
12764var ReactOwner = {
12765
12766 /**
12767 * @param {?object} object
12768 * @return {boolean} True if `object` is a valid owner.
12769 * @final
12770 */
12771 isValidOwner: function (object) {
12772 return !!(object && typeof object.attachRef === 'function' && typeof object.detachRef === 'function');
12773 },
12774
12775 /**
12776 * Adds a component by ref to an owner component.
12777 *
12778 * @param {ReactComponent} component Component to reference.
12779 * @param {string} ref Name by which to refer to the component.
12780 * @param {ReactOwner} owner Component on which to record the ref.
12781 * @final
12782 * @internal
12783 */
12784 addComponentAsRefTo: function (component, ref, owner) {
12785 !ReactOwner.isValidOwner(owner) ? "development" !== 'production' ? invariant(false, 'addComponentAsRefTo(...): Only a ReactOwner can have refs. You might ' + 'be adding a ref to a component that was not created inside a component\'s ' + '`render` method, or you have multiple copies of React loaded ' + '(details: https://fb.me/react-refs-must-have-owner).') : invariant(false) : undefined;
12786 owner.attachRef(ref, component);
12787 },
12788
12789 /**
12790 * Removes a component by ref from an owner component.
12791 *
12792 * @param {ReactComponent} component Component to dereference.
12793 * @param {string} ref Name of the ref to remove.
12794 * @param {ReactOwner} owner Component on which the ref is recorded.
12795 * @final
12796 * @internal
12797 */
12798 removeComponentAsRefFrom: function (component, ref, owner) {
12799 !ReactOwner.isValidOwner(owner) ? "development" !== 'production' ? invariant(false, 'removeComponentAsRefFrom(...): Only a ReactOwner can have refs. You might ' + 'be removing a ref to a component that was not created inside a component\'s ' + '`render` method, or you have multiple copies of React loaded ' + '(details: https://fb.me/react-refs-must-have-owner).') : invariant(false) : undefined;
12800 // Check that `component` is still the current ref because we do not want to
12801 // detach the ref if another component stole it.
12802 if (owner.getPublicInstance().refs[ref] === component.getPublicInstance()) {
12803 owner.detachRef(ref);
12804 }
12805 }
12806
12807};
12808
12809module.exports = ReactOwner;
12810},{"161":161}],78:[function(_dereq_,module,exports){
12811/**
12812 * Copyright 2013-2015, Facebook, Inc.
12813 * All rights reserved.
12814 *
12815 * This source code is licensed under the BSD-style license found in the
12816 * LICENSE file in the root directory of this source tree. An additional grant
12817 * of patent rights can be found in the PATENTS file in the same directory.
12818 *
12819 * @providesModule ReactPerf
12820 * @typechecks static-only
12821 */
12822
12823'use strict';
12824
12825/**
12826 * ReactPerf is a general AOP system designed to measure performance. This
12827 * module only has the hooks: see ReactDefaultPerf for the analysis tool.
12828 */
12829var ReactPerf = {
12830 /**
12831 * Boolean to enable/disable measurement. Set to false by default to prevent
12832 * accidental logging and perf loss.
12833 */
12834 enableMeasure: false,
12835
12836 /**
12837 * Holds onto the measure function in use. By default, don't measure
12838 * anything, but we'll override this if we inject a measure function.
12839 */
12840 storedMeasure: _noMeasure,
12841
12842 /**
12843 * @param {object} object
12844 * @param {string} objectName
12845 * @param {object<string>} methodNames
12846 */
12847 measureMethods: function (object, objectName, methodNames) {
12848 if ("development" !== 'production') {
12849 for (var key in methodNames) {
12850 if (!methodNames.hasOwnProperty(key)) {
12851 continue;
12852 }
12853 object[key] = ReactPerf.measure(objectName, methodNames[key], object[key]);
12854 }
12855 }
12856 },
12857
12858 /**
12859 * Use this to wrap methods you want to measure. Zero overhead in production.
12860 *
12861 * @param {string} objName
12862 * @param {string} fnName
12863 * @param {function} func
12864 * @return {function}
12865 */
12866 measure: function (objName, fnName, func) {
12867 if ("development" !== 'production') {
12868 var measuredFunc = null;
12869 var wrapper = function () {
12870 if (ReactPerf.enableMeasure) {
12871 if (!measuredFunc) {
12872 measuredFunc = ReactPerf.storedMeasure(objName, fnName, func);
12873 }
12874 return measuredFunc.apply(this, arguments);
12875 }
12876 return func.apply(this, arguments);
12877 };
12878 wrapper.displayName = objName + '_' + fnName;
12879 return wrapper;
12880 }
12881 return func;
12882 },
12883
12884 injection: {
12885 /**
12886 * @param {function} measure
12887 */
12888 injectMeasure: function (measure) {
12889 ReactPerf.storedMeasure = measure;
12890 }
12891 }
12892};
12893
12894/**
12895 * Simply passes through the measured function, without measuring it.
12896 *
12897 * @param {string} objName
12898 * @param {string} fnName
12899 * @param {function} func
12900 * @return {function}
12901 */
12902function _noMeasure(objName, fnName, func) {
12903 return func;
12904}
12905
12906module.exports = ReactPerf;
12907},{}],79:[function(_dereq_,module,exports){
12908/**
12909 * Copyright 2013-2015, Facebook, Inc.
12910 * All rights reserved.
12911 *
12912 * This source code is licensed under the BSD-style license found in the
12913 * LICENSE file in the root directory of this source tree. An additional grant
12914 * of patent rights can be found in the PATENTS file in the same directory.
12915 *
12916 * @providesModule ReactPropTransferer
12917 */
12918
12919'use strict';
12920
12921var assign = _dereq_(24);
12922var emptyFunction = _dereq_(153);
12923var joinClasses = _dereq_(164);
12924
12925/**
12926 * Creates a transfer strategy that will merge prop values using the supplied
12927 * `mergeStrategy`. If a prop was previously unset, this just sets it.
12928 *
12929 * @param {function} mergeStrategy
12930 * @return {function}
12931 */
12932function createTransferStrategy(mergeStrategy) {
12933 return function (props, key, value) {
12934 if (!props.hasOwnProperty(key)) {
12935 props[key] = value;
12936 } else {
12937 props[key] = mergeStrategy(props[key], value);
12938 }
12939 };
12940}
12941
12942var transferStrategyMerge = createTransferStrategy(function (a, b) {
12943 // `merge` overrides the first object's (`props[key]` above) keys using the
12944 // second object's (`value`) keys. An object's style's existing `propA` would
12945 // get overridden. Flip the order here.
12946 return assign({}, b, a);
12947});
12948
12949/**
12950 * Transfer strategies dictate how props are transferred by `transferPropsTo`.
12951 * NOTE: if you add any more exceptions to this list you should be sure to
12952 * update `cloneWithProps()` accordingly.
12953 */
12954var TransferStrategies = {
12955 /**
12956 * Never transfer `children`.
12957 */
12958 children: emptyFunction,
12959 /**
12960 * Transfer the `className` prop by merging them.
12961 */
12962 className: createTransferStrategy(joinClasses),
12963 /**
12964 * Transfer the `style` prop (which is an object) by merging them.
12965 */
12966 style: transferStrategyMerge
12967};
12968
12969/**
12970 * Mutates the first argument by transferring the properties from the second
12971 * argument.
12972 *
12973 * @param {object} props
12974 * @param {object} newProps
12975 * @return {object}
12976 */
12977function transferInto(props, newProps) {
12978 for (var thisKey in newProps) {
12979 if (!newProps.hasOwnProperty(thisKey)) {
12980 continue;
12981 }
12982
12983 var transferStrategy = TransferStrategies[thisKey];
12984
12985 if (transferStrategy && TransferStrategies.hasOwnProperty(thisKey)) {
12986 transferStrategy(props, thisKey, newProps[thisKey]);
12987 } else if (!props.hasOwnProperty(thisKey)) {
12988 props[thisKey] = newProps[thisKey];
12989 }
12990 }
12991 return props;
12992}
12993
12994/**
12995 * ReactPropTransferer are capable of transferring props to another component
12996 * using a `transferPropsTo` method.
12997 *
12998 * @class ReactPropTransferer
12999 */
13000var ReactPropTransferer = {
13001
13002 /**
13003 * Merge two props objects using TransferStrategies.
13004 *
13005 * @param {object} oldProps original props (they take precedence)
13006 * @param {object} newProps new props to merge in
13007 * @return {object} a new object containing both sets of props merged.
13008 */
13009 mergeProps: function (oldProps, newProps) {
13010 return transferInto(assign({}, oldProps), newProps);
13011 }
13012
13013};
13014
13015module.exports = ReactPropTransferer;
13016},{"153":153,"164":164,"24":24}],80:[function(_dereq_,module,exports){
13017/**
13018 * Copyright 2013-2015, Facebook, Inc.
13019 * All rights reserved.
13020 *
13021 * This source code is licensed under the BSD-style license found in the
13022 * LICENSE file in the root directory of this source tree. An additional grant
13023 * of patent rights can be found in the PATENTS file in the same directory.
13024 *
13025 * @providesModule ReactPropTypeLocationNames
13026 */
13027
13028'use strict';
13029
13030var ReactPropTypeLocationNames = {};
13031
13032if ("development" !== 'production') {
13033 ReactPropTypeLocationNames = {
13034 prop: 'prop',
13035 context: 'context',
13036 childContext: 'child context'
13037 };
13038}
13039
13040module.exports = ReactPropTypeLocationNames;
13041},{}],81:[function(_dereq_,module,exports){
13042/**
13043 * Copyright 2013-2015, Facebook, Inc.
13044 * All rights reserved.
13045 *
13046 * This source code is licensed under the BSD-style license found in the
13047 * LICENSE file in the root directory of this source tree. An additional grant
13048 * of patent rights can be found in the PATENTS file in the same directory.
13049 *
13050 * @providesModule ReactPropTypeLocations
13051 */
13052
13053'use strict';
13054
13055var keyMirror = _dereq_(165);
13056
13057var ReactPropTypeLocations = keyMirror({
13058 prop: null,
13059 context: null,
13060 childContext: null
13061});
13062
13063module.exports = ReactPropTypeLocations;
13064},{"165":165}],82:[function(_dereq_,module,exports){
13065/**
13066 * Copyright 2013-2015, Facebook, Inc.
13067 * All rights reserved.
13068 *
13069 * This source code is licensed under the BSD-style license found in the
13070 * LICENSE file in the root directory of this source tree. An additional grant
13071 * of patent rights can be found in the PATENTS file in the same directory.
13072 *
13073 * @providesModule ReactPropTypes
13074 */
13075
13076'use strict';
13077
13078var ReactElement = _dereq_(57);
13079var ReactPropTypeLocationNames = _dereq_(80);
13080
13081var emptyFunction = _dereq_(153);
13082var getIteratorFn = _dereq_(129);
13083
13084/**
13085 * Collection of methods that allow declaration and validation of props that are
13086 * supplied to React components. Example usage:
13087 *
13088 * var Props = require('ReactPropTypes');
13089 * var MyArticle = React.createClass({
13090 * propTypes: {
13091 * // An optional string prop named "description".
13092 * description: Props.string,
13093 *
13094 * // A required enum prop named "category".
13095 * category: Props.oneOf(['News','Photos']).isRequired,
13096 *
13097 * // A prop named "dialog" that requires an instance of Dialog.
13098 * dialog: Props.instanceOf(Dialog).isRequired
13099 * },
13100 * render: function() { ... }
13101 * });
13102 *
13103 * A more formal specification of how these methods are used:
13104 *
13105 * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
13106 * decl := ReactPropTypes.{type}(.isRequired)?
13107 *
13108 * Each and every declaration produces a function with the same signature. This
13109 * allows the creation of custom validation functions. For example:
13110 *
13111 * var MyLink = React.createClass({
13112 * propTypes: {
13113 * // An optional string or URI prop named "href".
13114 * href: function(props, propName, componentName) {
13115 * var propValue = props[propName];
13116 * if (propValue != null && typeof propValue !== 'string' &&
13117 * !(propValue instanceof URI)) {
13118 * return new Error(
13119 * 'Expected a string or an URI for ' + propName + ' in ' +
13120 * componentName
13121 * );
13122 * }
13123 * }
13124 * },
13125 * render: function() {...}
13126 * });
13127 *
13128 * @internal
13129 */
13130
13131var ANONYMOUS = '<<anonymous>>';
13132
13133var ReactPropTypes = {
13134 array: createPrimitiveTypeChecker('array'),
13135 bool: createPrimitiveTypeChecker('boolean'),
13136 func: createPrimitiveTypeChecker('function'),
13137 number: createPrimitiveTypeChecker('number'),
13138 object: createPrimitiveTypeChecker('object'),
13139 string: createPrimitiveTypeChecker('string'),
13140
13141 any: createAnyTypeChecker(),
13142 arrayOf: createArrayOfTypeChecker,
13143 element: createElementTypeChecker(),
13144 instanceOf: createInstanceTypeChecker,
13145 node: createNodeChecker(),
13146 objectOf: createObjectOfTypeChecker,
13147 oneOf: createEnumTypeChecker,
13148 oneOfType: createUnionTypeChecker,
13149 shape: createShapeTypeChecker
13150};
13151
13152function createChainableTypeChecker(validate) {
13153 function checkType(isRequired, props, propName, componentName, location, propFullName) {
13154 componentName = componentName || ANONYMOUS;
13155 propFullName = propFullName || propName;
13156 if (props[propName] == null) {
13157 var locationName = ReactPropTypeLocationNames[location];
13158 if (isRequired) {
13159 return new Error('Required ' + locationName + ' `' + propFullName + '` was not specified in ' + ('`' + componentName + '`.'));
13160 }
13161 return null;
13162 } else {
13163 return validate(props, propName, componentName, location, propFullName);
13164 }
13165 }
13166
13167 var chainedCheckType = checkType.bind(null, false);
13168 chainedCheckType.isRequired = checkType.bind(null, true);
13169
13170 return chainedCheckType;
13171}
13172
13173function createPrimitiveTypeChecker(expectedType) {
13174 function validate(props, propName, componentName, location, propFullName) {
13175 var propValue = props[propName];
13176 var propType = getPropType(propValue);
13177 if (propType !== expectedType) {
13178 var locationName = ReactPropTypeLocationNames[location];
13179 // `propValue` being instance of, say, date/regexp, pass the 'object'
13180 // check, but we can offer a more precise error message here rather than
13181 // 'of type `object`'.
13182 var preciseType = getPreciseType(propValue);
13183
13184 return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
13185 }
13186 return null;
13187 }
13188 return createChainableTypeChecker(validate);
13189}
13190
13191function createAnyTypeChecker() {
13192 return createChainableTypeChecker(emptyFunction.thatReturns(null));
13193}
13194
13195function createArrayOfTypeChecker(typeChecker) {
13196 function validate(props, propName, componentName, location, propFullName) {
13197 var propValue = props[propName];
13198 if (!Array.isArray(propValue)) {
13199 var locationName = ReactPropTypeLocationNames[location];
13200 var propType = getPropType(propValue);
13201 return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
13202 }
13203 for (var i = 0; i < propValue.length; i++) {
13204 var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']');
13205 if (error instanceof Error) {
13206 return error;
13207 }
13208 }
13209 return null;
13210 }
13211 return createChainableTypeChecker(validate);
13212}
13213
13214function createElementTypeChecker() {
13215 function validate(props, propName, componentName, location, propFullName) {
13216 if (!ReactElement.isValidElement(props[propName])) {
13217 var locationName = ReactPropTypeLocationNames[location];
13218 return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a single ReactElement.'));
13219 }
13220 return null;
13221 }
13222 return createChainableTypeChecker(validate);
13223}
13224
13225function createInstanceTypeChecker(expectedClass) {
13226 function validate(props, propName, componentName, location, propFullName) {
13227 if (!(props[propName] instanceof expectedClass)) {
13228 var locationName = ReactPropTypeLocationNames[location];
13229 var expectedClassName = expectedClass.name || ANONYMOUS;
13230 var actualClassName = getClassName(props[propName]);
13231 return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
13232 }
13233 return null;
13234 }
13235 return createChainableTypeChecker(validate);
13236}
13237
13238function createEnumTypeChecker(expectedValues) {
13239 if (!Array.isArray(expectedValues)) {
13240 return createChainableTypeChecker(function () {
13241 return new Error('Invalid argument supplied to oneOf, expected an instance of array.');
13242 });
13243 }
13244
13245 function validate(props, propName, componentName, location, propFullName) {
13246 var propValue = props[propName];
13247 for (var i = 0; i < expectedValues.length; i++) {
13248 if (propValue === expectedValues[i]) {
13249 return null;
13250 }
13251 }
13252
13253 var locationName = ReactPropTypeLocationNames[location];
13254 var valuesString = JSON.stringify(expectedValues);
13255 return new Error('Invalid ' + locationName + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
13256 }
13257 return createChainableTypeChecker(validate);
13258}
13259
13260function createObjectOfTypeChecker(typeChecker) {
13261 function validate(props, propName, componentName, location, propFullName) {
13262 var propValue = props[propName];
13263 var propType = getPropType(propValue);
13264 if (propType !== 'object') {
13265 var locationName = ReactPropTypeLocationNames[location];
13266 return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
13267 }
13268 for (var key in propValue) {
13269 if (propValue.hasOwnProperty(key)) {
13270 var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key);
13271 if (error instanceof Error) {
13272 return error;
13273 }
13274 }
13275 }
13276 return null;
13277 }
13278 return createChainableTypeChecker(validate);
13279}
13280
13281function createUnionTypeChecker(arrayOfTypeCheckers) {
13282 if (!Array.isArray(arrayOfTypeCheckers)) {
13283 return createChainableTypeChecker(function () {
13284 return new Error('Invalid argument supplied to oneOfType, expected an instance of array.');
13285 });
13286 }
13287
13288 function validate(props, propName, componentName, location, propFullName) {
13289 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
13290 var checker = arrayOfTypeCheckers[i];
13291 if (checker(props, propName, componentName, location, propFullName) == null) {
13292 return null;
13293 }
13294 }
13295
13296 var locationName = ReactPropTypeLocationNames[location];
13297 return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
13298 }
13299 return createChainableTypeChecker(validate);
13300}
13301
13302function createNodeChecker() {
13303 function validate(props, propName, componentName, location, propFullName) {
13304 if (!isNode(props[propName])) {
13305 var locationName = ReactPropTypeLocationNames[location];
13306 return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
13307 }
13308 return null;
13309 }
13310 return createChainableTypeChecker(validate);
13311}
13312
13313function createShapeTypeChecker(shapeTypes) {
13314 function validate(props, propName, componentName, location, propFullName) {
13315 var propValue = props[propName];
13316 var propType = getPropType(propValue);
13317 if (propType !== 'object') {
13318 var locationName = ReactPropTypeLocationNames[location];
13319 return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
13320 }
13321 for (var key in shapeTypes) {
13322 var checker = shapeTypes[key];
13323 if (!checker) {
13324 continue;
13325 }
13326 var error = checker(propValue, key, componentName, location, propFullName + '.' + key);
13327 if (error) {
13328 return error;
13329 }
13330 }
13331 return null;
13332 }
13333 return createChainableTypeChecker(validate);
13334}
13335
13336function isNode(propValue) {
13337 switch (typeof propValue) {
13338 case 'number':
13339 case 'string':
13340 case 'undefined':
13341 return true;
13342 case 'boolean':
13343 return !propValue;
13344 case 'object':
13345 if (Array.isArray(propValue)) {
13346 return propValue.every(isNode);
13347 }
13348 if (propValue === null || ReactElement.isValidElement(propValue)) {
13349 return true;
13350 }
13351
13352 var iteratorFn = getIteratorFn(propValue);
13353 if (iteratorFn) {
13354 var iterator = iteratorFn.call(propValue);
13355 var step;
13356 if (iteratorFn !== propValue.entries) {
13357 while (!(step = iterator.next()).done) {
13358 if (!isNode(step.value)) {
13359 return false;
13360 }
13361 }
13362 } else {
13363 // Iterator will provide entry [k,v] tuples rather than values.
13364 while (!(step = iterator.next()).done) {
13365 var entry = step.value;
13366 if (entry) {
13367 if (!isNode(entry[1])) {
13368 return false;
13369 }
13370 }
13371 }
13372 }
13373 } else {
13374 return false;
13375 }
13376
13377 return true;
13378 default:
13379 return false;
13380 }
13381}
13382
13383// Equivalent of `typeof` but with special handling for array and regexp.
13384function getPropType(propValue) {
13385 var propType = typeof propValue;
13386 if (Array.isArray(propValue)) {
13387 return 'array';
13388 }
13389 if (propValue instanceof RegExp) {
13390 // Old webkits (at least until Android 4.0) return 'function' rather than
13391 // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
13392 // passes PropTypes.object.
13393 return 'object';
13394 }
13395 return propType;
13396}
13397
13398// This handles more types than `getPropType`. Only used for error messages.
13399// See `createPrimitiveTypeChecker`.
13400function getPreciseType(propValue) {
13401 var propType = getPropType(propValue);
13402 if (propType === 'object') {
13403 if (propValue instanceof Date) {
13404 return 'date';
13405 } else if (propValue instanceof RegExp) {
13406 return 'regexp';
13407 }
13408 }
13409 return propType;
13410}
13411
13412// Returns class name of the object, if any.
13413function getClassName(propValue) {
13414 if (!propValue.constructor || !propValue.constructor.name) {
13415 return '<<anonymous>>';
13416 }
13417 return propValue.constructor.name;
13418}
13419
13420module.exports = ReactPropTypes;
13421},{"129":129,"153":153,"57":57,"80":80}],83:[function(_dereq_,module,exports){
13422/**
13423 * Copyright 2013-2015, Facebook, Inc.
13424 * All rights reserved.
13425 *
13426 * This source code is licensed under the BSD-style license found in the
13427 * LICENSE file in the root directory of this source tree. An additional grant
13428 * of patent rights can be found in the PATENTS file in the same directory.
13429 *
13430 * @providesModule ReactReconcileTransaction
13431 * @typechecks static-only
13432 */
13433
13434'use strict';
13435
13436var CallbackQueue = _dereq_(6);
13437var PooledClass = _dereq_(25);
13438var ReactBrowserEventEmitter = _dereq_(28);
13439var ReactDOMFeatureFlags = _dereq_(44);
13440var ReactInputSelection = _dereq_(66);
13441var Transaction = _dereq_(113);
13442
13443var assign = _dereq_(24);
13444
13445/**
13446 * Ensures that, when possible, the selection range (currently selected text
13447 * input) is not disturbed by performing the transaction.
13448 */
13449var SELECTION_RESTORATION = {
13450 /**
13451 * @return {Selection} Selection information.
13452 */
13453 initialize: ReactInputSelection.getSelectionInformation,
13454 /**
13455 * @param {Selection} sel Selection information returned from `initialize`.
13456 */
13457 close: ReactInputSelection.restoreSelection
13458};
13459
13460/**
13461 * Suppresses events (blur/focus) that could be inadvertently dispatched due to
13462 * high level DOM manipulations (like temporarily removing a text input from the
13463 * DOM).
13464 */
13465var EVENT_SUPPRESSION = {
13466 /**
13467 * @return {boolean} The enabled status of `ReactBrowserEventEmitter` before
13468 * the reconciliation.
13469 */
13470 initialize: function () {
13471 var currentlyEnabled = ReactBrowserEventEmitter.isEnabled();
13472 ReactBrowserEventEmitter.setEnabled(false);
13473 return currentlyEnabled;
13474 },
13475
13476 /**
13477 * @param {boolean} previouslyEnabled Enabled status of
13478 * `ReactBrowserEventEmitter` before the reconciliation occurred. `close`
13479 * restores the previous value.
13480 */
13481 close: function (previouslyEnabled) {
13482 ReactBrowserEventEmitter.setEnabled(previouslyEnabled);
13483 }
13484};
13485
13486/**
13487 * Provides a queue for collecting `componentDidMount` and
13488 * `componentDidUpdate` callbacks during the the transaction.
13489 */
13490var ON_DOM_READY_QUEUEING = {
13491 /**
13492 * Initializes the internal `onDOMReady` queue.
13493 */
13494 initialize: function () {
13495 this.reactMountReady.reset();
13496 },
13497
13498 /**
13499 * After DOM is flushed, invoke all registered `onDOMReady` callbacks.
13500 */
13501 close: function () {
13502 this.reactMountReady.notifyAll();
13503 }
13504};
13505
13506/**
13507 * Executed within the scope of the `Transaction` instance. Consider these as
13508 * being member methods, but with an implied ordering while being isolated from
13509 * each other.
13510 */
13511var TRANSACTION_WRAPPERS = [SELECTION_RESTORATION, EVENT_SUPPRESSION, ON_DOM_READY_QUEUEING];
13512
13513/**
13514 * Currently:
13515 * - The order that these are listed in the transaction is critical:
13516 * - Suppresses events.
13517 * - Restores selection range.
13518 *
13519 * Future:
13520 * - Restore document/overflow scroll positions that were unintentionally
13521 * modified via DOM insertions above the top viewport boundary.
13522 * - Implement/integrate with customized constraint based layout system and keep
13523 * track of which dimensions must be remeasured.
13524 *
13525 * @class ReactReconcileTransaction
13526 */
13527function ReactReconcileTransaction(forceHTML) {
13528 this.reinitializeTransaction();
13529 // Only server-side rendering really needs this option (see
13530 // `ReactServerRendering`), but server-side uses
13531 // `ReactServerRenderingTransaction` instead. This option is here so that it's
13532 // accessible and defaults to false when `ReactDOMComponent` and
13533 // `ReactTextComponent` checks it in `mountComponent`.`
13534 this.renderToStaticMarkup = false;
13535 this.reactMountReady = CallbackQueue.getPooled(null);
13536 this.useCreateElement = !forceHTML && ReactDOMFeatureFlags.useCreateElement;
13537}
13538
13539var Mixin = {
13540 /**
13541 * @see Transaction
13542 * @abstract
13543 * @final
13544 * @return {array<object>} List of operation wrap procedures.
13545 * TODO: convert to array<TransactionWrapper>
13546 */
13547 getTransactionWrappers: function () {
13548 return TRANSACTION_WRAPPERS;
13549 },
13550
13551 /**
13552 * @return {object} The queue to collect `onDOMReady` callbacks with.
13553 */
13554 getReactMountReady: function () {
13555 return this.reactMountReady;
13556 },
13557
13558 /**
13559 * `PooledClass` looks for this, and will invoke this before allowing this
13560 * instance to be reused.
13561 */
13562 destructor: function () {
13563 CallbackQueue.release(this.reactMountReady);
13564 this.reactMountReady = null;
13565 }
13566};
13567
13568assign(ReactReconcileTransaction.prototype, Transaction.Mixin, Mixin);
13569
13570PooledClass.addPoolingTo(ReactReconcileTransaction);
13571
13572module.exports = ReactReconcileTransaction;
13573},{"113":113,"24":24,"25":25,"28":28,"44":44,"6":6,"66":66}],84:[function(_dereq_,module,exports){
13574/**
13575 * Copyright 2013-2015, Facebook, Inc.
13576 * All rights reserved.
13577 *
13578 * This source code is licensed under the BSD-style license found in the
13579 * LICENSE file in the root directory of this source tree. An additional grant
13580 * of patent rights can be found in the PATENTS file in the same directory.
13581 *
13582 * @providesModule ReactReconciler
13583 */
13584
13585'use strict';
13586
13587var ReactRef = _dereq_(85);
13588
13589/**
13590 * Helper to call ReactRef.attachRefs with this composite component, split out
13591 * to avoid allocations in the transaction mount-ready queue.
13592 */
13593function attachRefs() {
13594 ReactRef.attachRefs(this, this._currentElement);
13595}
13596
13597var ReactReconciler = {
13598
13599 /**
13600 * Initializes the component, renders markup, and registers event listeners.
13601 *
13602 * @param {ReactComponent} internalInstance
13603 * @param {string} rootID DOM ID of the root node.
13604 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
13605 * @return {?string} Rendered markup to be inserted into the DOM.
13606 * @final
13607 * @internal
13608 */
13609 mountComponent: function (internalInstance, rootID, transaction, context) {
13610 var markup = internalInstance.mountComponent(rootID, transaction, context);
13611 if (internalInstance._currentElement && internalInstance._currentElement.ref != null) {
13612 transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
13613 }
13614 return markup;
13615 },
13616
13617 /**
13618 * Releases any resources allocated by `mountComponent`.
13619 *
13620 * @final
13621 * @internal
13622 */
13623 unmountComponent: function (internalInstance) {
13624 ReactRef.detachRefs(internalInstance, internalInstance._currentElement);
13625 internalInstance.unmountComponent();
13626 },
13627
13628 /**
13629 * Update a component using a new element.
13630 *
13631 * @param {ReactComponent} internalInstance
13632 * @param {ReactElement} nextElement
13633 * @param {ReactReconcileTransaction} transaction
13634 * @param {object} context
13635 * @internal
13636 */
13637 receiveComponent: function (internalInstance, nextElement, transaction, context) {
13638 var prevElement = internalInstance._currentElement;
13639
13640 if (nextElement === prevElement && context === internalInstance._context) {
13641 // Since elements are immutable after the owner is rendered,
13642 // we can do a cheap identity compare here to determine if this is a
13643 // superfluous reconcile. It's possible for state to be mutable but such
13644 // change should trigger an update of the owner which would recreate
13645 // the element. We explicitly check for the existence of an owner since
13646 // it's possible for an element created outside a composite to be
13647 // deeply mutated and reused.
13648
13649 // TODO: Bailing out early is just a perf optimization right?
13650 // TODO: Removing the return statement should affect correctness?
13651 return;
13652 }
13653
13654 var refsChanged = ReactRef.shouldUpdateRefs(prevElement, nextElement);
13655
13656 if (refsChanged) {
13657 ReactRef.detachRefs(internalInstance, prevElement);
13658 }
13659
13660 internalInstance.receiveComponent(nextElement, transaction, context);
13661
13662 if (refsChanged && internalInstance._currentElement && internalInstance._currentElement.ref != null) {
13663 transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
13664 }
13665 },
13666
13667 /**
13668 * Flush any dirty changes in a component.
13669 *
13670 * @param {ReactComponent} internalInstance
13671 * @param {ReactReconcileTransaction} transaction
13672 * @internal
13673 */
13674 performUpdateIfNecessary: function (internalInstance, transaction) {
13675 internalInstance.performUpdateIfNecessary(transaction);
13676 }
13677
13678};
13679
13680module.exports = ReactReconciler;
13681},{"85":85}],85:[function(_dereq_,module,exports){
13682/**
13683 * Copyright 2013-2015, Facebook, Inc.
13684 * All rights reserved.
13685 *
13686 * This source code is licensed under the BSD-style license found in the
13687 * LICENSE file in the root directory of this source tree. An additional grant
13688 * of patent rights can be found in the PATENTS file in the same directory.
13689 *
13690 * @providesModule ReactRef
13691 */
13692
13693'use strict';
13694
13695var ReactOwner = _dereq_(77);
13696
13697var ReactRef = {};
13698
13699function attachRef(ref, component, owner) {
13700 if (typeof ref === 'function') {
13701 ref(component.getPublicInstance());
13702 } else {
13703 // Legacy ref
13704 ReactOwner.addComponentAsRefTo(component, ref, owner);
13705 }
13706}
13707
13708function detachRef(ref, component, owner) {
13709 if (typeof ref === 'function') {
13710 ref(null);
13711 } else {
13712 // Legacy ref
13713 ReactOwner.removeComponentAsRefFrom(component, ref, owner);
13714 }
13715}
13716
13717ReactRef.attachRefs = function (instance, element) {
13718 if (element === null || element === false) {
13719 return;
13720 }
13721 var ref = element.ref;
13722 if (ref != null) {
13723 attachRef(ref, instance, element._owner);
13724 }
13725};
13726
13727ReactRef.shouldUpdateRefs = function (prevElement, nextElement) {
13728 // If either the owner or a `ref` has changed, make sure the newest owner
13729 // has stored a reference to `this`, and the previous owner (if different)
13730 // has forgotten the reference to `this`. We use the element instead
13731 // of the public this.props because the post processing cannot determine
13732 // a ref. The ref conceptually lives on the element.
13733
13734 // TODO: Should this even be possible? The owner cannot change because
13735 // it's forbidden by shouldUpdateReactComponent. The ref can change
13736 // if you swap the keys of but not the refs. Reconsider where this check
13737 // is made. It probably belongs where the key checking and
13738 // instantiateReactComponent is done.
13739
13740 var prevEmpty = prevElement === null || prevElement === false;
13741 var nextEmpty = nextElement === null || nextElement === false;
13742
13743 return(
13744 // This has a few false positives w/r/t empty components.
13745 prevEmpty || nextEmpty || nextElement._owner !== prevElement._owner || nextElement.ref !== prevElement.ref
13746 );
13747};
13748
13749ReactRef.detachRefs = function (instance, element) {
13750 if (element === null || element === false) {
13751 return;
13752 }
13753 var ref = element.ref;
13754 if (ref != null) {
13755 detachRef(ref, instance, element._owner);
13756 }
13757};
13758
13759module.exports = ReactRef;
13760},{"77":77}],86:[function(_dereq_,module,exports){
13761/**
13762 * Copyright 2013-2015, Facebook, Inc.
13763 * All rights reserved.
13764 *
13765 * This source code is licensed under the BSD-style license found in the
13766 * LICENSE file in the root directory of this source tree. An additional grant
13767 * of patent rights can be found in the PATENTS file in the same directory.
13768 *
13769 * @providesModule ReactRootIndex
13770 * @typechecks
13771 */
13772
13773'use strict';
13774
13775var ReactRootIndexInjection = {
13776 /**
13777 * @param {function} _createReactRootIndex
13778 */
13779 injectCreateReactRootIndex: function (_createReactRootIndex) {
13780 ReactRootIndex.createReactRootIndex = _createReactRootIndex;
13781 }
13782};
13783
13784var ReactRootIndex = {
13785 createReactRootIndex: null,
13786 injection: ReactRootIndexInjection
13787};
13788
13789module.exports = ReactRootIndex;
13790},{}],87:[function(_dereq_,module,exports){
13791/**
13792 * Copyright 2014-2015, Facebook, Inc.
13793 * All rights reserved.
13794 *
13795 * This source code is licensed under the BSD-style license found in the
13796 * LICENSE file in the root directory of this source tree. An additional grant
13797 * of patent rights can be found in the PATENTS file in the same directory.
13798 *
13799 * @providesModule ReactServerBatchingStrategy
13800 * @typechecks
13801 */
13802
13803'use strict';
13804
13805var ReactServerBatchingStrategy = {
13806 isBatchingUpdates: false,
13807 batchedUpdates: function (callback) {
13808 // Don't do anything here. During the server rendering we don't want to
13809 // schedule any updates. We will simply ignore them.
13810 }
13811};
13812
13813module.exports = ReactServerBatchingStrategy;
13814},{}],88:[function(_dereq_,module,exports){
13815/**
13816 * Copyright 2013-2015, Facebook, Inc.
13817 * All rights reserved.
13818 *
13819 * This source code is licensed under the BSD-style license found in the
13820 * LICENSE file in the root directory of this source tree. An additional grant
13821 * of patent rights can be found in the PATENTS file in the same directory.
13822 *
13823 * @typechecks static-only
13824 * @providesModule ReactServerRendering
13825 */
13826'use strict';
13827
13828var ReactDefaultBatchingStrategy = _dereq_(53);
13829var ReactElement = _dereq_(57);
13830var ReactInstanceHandles = _dereq_(67);
13831var ReactMarkupChecksum = _dereq_(71);
13832var ReactServerBatchingStrategy = _dereq_(87);
13833var ReactServerRenderingTransaction = _dereq_(89);
13834var ReactUpdates = _dereq_(96);
13835
13836var emptyObject = _dereq_(154);
13837var instantiateReactComponent = _dereq_(132);
13838var invariant = _dereq_(161);
13839
13840/**
13841 * @param {ReactElement} element
13842 * @return {string} the HTML markup
13843 */
13844function renderToString(element) {
13845 !ReactElement.isValidElement(element) ? "development" !== 'production' ? invariant(false, 'renderToString(): You must pass a valid ReactElement.') : invariant(false) : undefined;
13846
13847 var transaction;
13848 try {
13849 ReactUpdates.injection.injectBatchingStrategy(ReactServerBatchingStrategy);
13850
13851 var id = ReactInstanceHandles.createReactRootID();
13852 transaction = ReactServerRenderingTransaction.getPooled(false);
13853
13854 return transaction.perform(function () {
13855 var componentInstance = instantiateReactComponent(element, null);
13856 var markup = componentInstance.mountComponent(id, transaction, emptyObject);
13857 return ReactMarkupChecksum.addChecksumToMarkup(markup);
13858 }, null);
13859 } finally {
13860 ReactServerRenderingTransaction.release(transaction);
13861 // Revert to the DOM batching strategy since these two renderers
13862 // currently share these stateful modules.
13863 ReactUpdates.injection.injectBatchingStrategy(ReactDefaultBatchingStrategy);
13864 }
13865}
13866
13867/**
13868 * @param {ReactElement} element
13869 * @return {string} the HTML markup, without the extra React ID and checksum
13870 * (for generating static pages)
13871 */
13872function renderToStaticMarkup(element) {
13873 !ReactElement.isValidElement(element) ? "development" !== 'production' ? invariant(false, 'renderToStaticMarkup(): You must pass a valid ReactElement.') : invariant(false) : undefined;
13874
13875 var transaction;
13876 try {
13877 ReactUpdates.injection.injectBatchingStrategy(ReactServerBatchingStrategy);
13878
13879 var id = ReactInstanceHandles.createReactRootID();
13880 transaction = ReactServerRenderingTransaction.getPooled(true);
13881
13882 return transaction.perform(function () {
13883 var componentInstance = instantiateReactComponent(element, null);
13884 return componentInstance.mountComponent(id, transaction, emptyObject);
13885 }, null);
13886 } finally {
13887 ReactServerRenderingTransaction.release(transaction);
13888 // Revert to the DOM batching strategy since these two renderers
13889 // currently share these stateful modules.
13890 ReactUpdates.injection.injectBatchingStrategy(ReactDefaultBatchingStrategy);
13891 }
13892}
13893
13894module.exports = {
13895 renderToString: renderToString,
13896 renderToStaticMarkup: renderToStaticMarkup
13897};
13898},{"132":132,"154":154,"161":161,"53":53,"57":57,"67":67,"71":71,"87":87,"89":89,"96":96}],89:[function(_dereq_,module,exports){
13899/**
13900 * Copyright 2014-2015, Facebook, Inc.
13901 * All rights reserved.
13902 *
13903 * This source code is licensed under the BSD-style license found in the
13904 * LICENSE file in the root directory of this source tree. An additional grant
13905 * of patent rights can be found in the PATENTS file in the same directory.
13906 *
13907 * @providesModule ReactServerRenderingTransaction
13908 * @typechecks
13909 */
13910
13911'use strict';
13912
13913var PooledClass = _dereq_(25);
13914var CallbackQueue = _dereq_(6);
13915var Transaction = _dereq_(113);
13916
13917var assign = _dereq_(24);
13918var emptyFunction = _dereq_(153);
13919
13920/**
13921 * Provides a `CallbackQueue` queue for collecting `onDOMReady` callbacks
13922 * during the performing of the transaction.
13923 */
13924var ON_DOM_READY_QUEUEING = {
13925 /**
13926 * Initializes the internal `onDOMReady` queue.
13927 */
13928 initialize: function () {
13929 this.reactMountReady.reset();
13930 },
13931
13932 close: emptyFunction
13933};
13934
13935/**
13936 * Executed within the scope of the `Transaction` instance. Consider these as
13937 * being member methods, but with an implied ordering while being isolated from
13938 * each other.
13939 */
13940var TRANSACTION_WRAPPERS = [ON_DOM_READY_QUEUEING];
13941
13942/**
13943 * @class ReactServerRenderingTransaction
13944 * @param {boolean} renderToStaticMarkup
13945 */
13946function ReactServerRenderingTransaction(renderToStaticMarkup) {
13947 this.reinitializeTransaction();
13948 this.renderToStaticMarkup = renderToStaticMarkup;
13949 this.reactMountReady = CallbackQueue.getPooled(null);
13950 this.useCreateElement = false;
13951}
13952
13953var Mixin = {
13954 /**
13955 * @see Transaction
13956 * @abstract
13957 * @final
13958 * @return {array} Empty list of operation wrap procedures.
13959 */
13960 getTransactionWrappers: function () {
13961 return TRANSACTION_WRAPPERS;
13962 },
13963
13964 /**
13965 * @return {object} The queue to collect `onDOMReady` callbacks with.
13966 */
13967 getReactMountReady: function () {
13968 return this.reactMountReady;
13969 },
13970
13971 /**
13972 * `PooledClass` looks for this, and will invoke this before allowing this
13973 * instance to be reused.
13974 */
13975 destructor: function () {
13976 CallbackQueue.release(this.reactMountReady);
13977 this.reactMountReady = null;
13978 }
13979};
13980
13981assign(ReactServerRenderingTransaction.prototype, Transaction.Mixin, Mixin);
13982
13983PooledClass.addPoolingTo(ReactServerRenderingTransaction);
13984
13985module.exports = ReactServerRenderingTransaction;
13986},{"113":113,"153":153,"24":24,"25":25,"6":6}],90:[function(_dereq_,module,exports){
13987/**
13988 * Copyright 2013-2015, Facebook, Inc.
13989 * All rights reserved.
13990 *
13991 * This source code is licensed under the BSD-style license found in the
13992 * LICENSE file in the root directory of this source tree. An additional grant
13993 * of patent rights can be found in the PATENTS file in the same directory.
13994 *
13995 * @providesModule ReactStateSetters
13996 */
13997
13998'use strict';
13999
14000var ReactStateSetters = {
14001 /**
14002 * Returns a function that calls the provided function, and uses the result
14003 * of that to set the component's state.
14004 *
14005 * @param {ReactCompositeComponent} component
14006 * @param {function} funcReturningState Returned callback uses this to
14007 * determine how to update state.
14008 * @return {function} callback that when invoked uses funcReturningState to
14009 * determined the object literal to setState.
14010 */
14011 createStateSetter: function (component, funcReturningState) {
14012 return function (a, b, c, d, e, f) {
14013 var partialState = funcReturningState.call(component, a, b, c, d, e, f);
14014 if (partialState) {
14015 component.setState(partialState);
14016 }
14017 };
14018 },
14019
14020 /**
14021 * Returns a single-argument callback that can be used to update a single
14022 * key in the component's state.
14023 *
14024 * Note: this is memoized function, which makes it inexpensive to call.
14025 *
14026 * @param {ReactCompositeComponent} component
14027 * @param {string} key The key in the state that you should update.
14028 * @return {function} callback of 1 argument which calls setState() with
14029 * the provided keyName and callback argument.
14030 */
14031 createStateKeySetter: function (component, key) {
14032 // Memoize the setters.
14033 var cache = component.__keySetters || (component.__keySetters = {});
14034 return cache[key] || (cache[key] = createStateKeySetter(component, key));
14035 }
14036};
14037
14038function createStateKeySetter(component, key) {
14039 // Partial state is allocated outside of the function closure so it can be
14040 // reused with every call, avoiding memory allocation when this function
14041 // is called.
14042 var partialState = {};
14043 return function stateKeySetter(value) {
14044 partialState[key] = value;
14045 component.setState(partialState);
14046 };
14047}
14048
14049ReactStateSetters.Mixin = {
14050 /**
14051 * Returns a function that calls the provided function, and uses the result
14052 * of that to set the component's state.
14053 *
14054 * For example, these statements are equivalent:
14055 *
14056 * this.setState({x: 1});
14057 * this.createStateSetter(function(xValue) {
14058 * return {x: xValue};
14059 * })(1);
14060 *
14061 * @param {function} funcReturningState Returned callback uses this to
14062 * determine how to update state.
14063 * @return {function} callback that when invoked uses funcReturningState to
14064 * determined the object literal to setState.
14065 */
14066 createStateSetter: function (funcReturningState) {
14067 return ReactStateSetters.createStateSetter(this, funcReturningState);
14068 },
14069
14070 /**
14071 * Returns a single-argument callback that can be used to update a single
14072 * key in the component's state.
14073 *
14074 * For example, these statements are equivalent:
14075 *
14076 * this.setState({x: 1});
14077 * this.createStateKeySetter('x')(1);
14078 *
14079 * Note: this is memoized function, which makes it inexpensive to call.
14080 *
14081 * @param {string} key The key in the state that you should update.
14082 * @return {function} callback of 1 argument which calls setState() with
14083 * the provided keyName and callback argument.
14084 */
14085 createStateKeySetter: function (key) {
14086 return ReactStateSetters.createStateKeySetter(this, key);
14087 }
14088};
14089
14090module.exports = ReactStateSetters;
14091},{}],91:[function(_dereq_,module,exports){
14092/**
14093 * Copyright 2013-2015, Facebook, Inc.
14094 * All rights reserved.
14095 *
14096 * This source code is licensed under the BSD-style license found in the
14097 * LICENSE file in the root directory of this source tree. An additional grant
14098 * of patent rights can be found in the PATENTS file in the same directory.
14099 *
14100 * @providesModule ReactTestUtils
14101 */
14102
14103'use strict';
14104
14105var EventConstants = _dereq_(15);
14106var EventPluginHub = _dereq_(16);
14107var EventPropagators = _dereq_(19);
14108var React = _dereq_(26);
14109var ReactDOM = _dereq_(40);
14110var ReactElement = _dereq_(57);
14111var ReactBrowserEventEmitter = _dereq_(28);
14112var ReactCompositeComponent = _dereq_(38);
14113var ReactInstanceHandles = _dereq_(67);
14114var ReactInstanceMap = _dereq_(68);
14115var ReactMount = _dereq_(72);
14116var ReactUpdates = _dereq_(96);
14117var SyntheticEvent = _dereq_(105);
14118
14119var assign = _dereq_(24);
14120var emptyObject = _dereq_(154);
14121var findDOMNode = _dereq_(122);
14122var invariant = _dereq_(161);
14123
14124var topLevelTypes = EventConstants.topLevelTypes;
14125
14126function Event(suffix) {}
14127
14128/**
14129 * @class ReactTestUtils
14130 */
14131
14132function findAllInRenderedTreeInternal(inst, test) {
14133 if (!inst || !inst.getPublicInstance) {
14134 return [];
14135 }
14136 var publicInst = inst.getPublicInstance();
14137 var ret = test(publicInst) ? [publicInst] : [];
14138 var currentElement = inst._currentElement;
14139 if (ReactTestUtils.isDOMComponent(publicInst)) {
14140 var renderedChildren = inst._renderedChildren;
14141 var key;
14142 for (key in renderedChildren) {
14143 if (!renderedChildren.hasOwnProperty(key)) {
14144 continue;
14145 }
14146 ret = ret.concat(findAllInRenderedTreeInternal(renderedChildren[key], test));
14147 }
14148 } else if (ReactElement.isValidElement(currentElement) && typeof currentElement.type === 'function') {
14149 ret = ret.concat(findAllInRenderedTreeInternal(inst._renderedComponent, test));
14150 }
14151 return ret;
14152}
14153
14154/**
14155 * Todo: Support the entire DOM.scry query syntax. For now, these simple
14156 * utilities will suffice for testing purposes.
14157 * @lends ReactTestUtils
14158 */
14159var ReactTestUtils = {
14160 renderIntoDocument: function (instance) {
14161 var div = document.createElement('div');
14162 // None of our tests actually require attaching the container to the
14163 // DOM, and doing so creates a mess that we rely on test isolation to
14164 // clean up, so we're going to stop honoring the name of this method
14165 // (and probably rename it eventually) if no problems arise.
14166 // document.documentElement.appendChild(div);
14167 return ReactDOM.render(instance, div);
14168 },
14169
14170 isElement: function (element) {
14171 return ReactElement.isValidElement(element);
14172 },
14173
14174 isElementOfType: function (inst, convenienceConstructor) {
14175 return ReactElement.isValidElement(inst) && inst.type === convenienceConstructor;
14176 },
14177
14178 isDOMComponent: function (inst) {
14179 return !!(inst && inst.nodeType === 1 && inst.tagName);
14180 },
14181
14182 isDOMComponentElement: function (inst) {
14183 return !!(inst && ReactElement.isValidElement(inst) && !!inst.tagName);
14184 },
14185
14186 isCompositeComponent: function (inst) {
14187 if (ReactTestUtils.isDOMComponent(inst)) {
14188 // Accessing inst.setState warns; just return false as that'll be what
14189 // this returns when we have DOM nodes as refs directly
14190 return false;
14191 }
14192 return inst != null && typeof inst.render === 'function' && typeof inst.setState === 'function';
14193 },
14194
14195 isCompositeComponentWithType: function (inst, type) {
14196 if (!ReactTestUtils.isCompositeComponent(inst)) {
14197 return false;
14198 }
14199 var internalInstance = ReactInstanceMap.get(inst);
14200 var constructor = internalInstance._currentElement.type;
14201
14202 return constructor === type;
14203 },
14204
14205 isCompositeComponentElement: function (inst) {
14206 if (!ReactElement.isValidElement(inst)) {
14207 return false;
14208 }
14209 // We check the prototype of the type that will get mounted, not the
14210 // instance itself. This is a future proof way of duck typing.
14211 var prototype = inst.type.prototype;
14212 return typeof prototype.render === 'function' && typeof prototype.setState === 'function';
14213 },
14214
14215 isCompositeComponentElementWithType: function (inst, type) {
14216 var internalInstance = ReactInstanceMap.get(inst);
14217 var constructor = internalInstance._currentElement.type;
14218
14219 return !!(ReactTestUtils.isCompositeComponentElement(inst) && constructor === type);
14220 },
14221
14222 getRenderedChildOfCompositeComponent: function (inst) {
14223 if (!ReactTestUtils.isCompositeComponent(inst)) {
14224 return null;
14225 }
14226 var internalInstance = ReactInstanceMap.get(inst);
14227 return internalInstance._renderedComponent.getPublicInstance();
14228 },
14229
14230 findAllInRenderedTree: function (inst, test) {
14231 if (!inst) {
14232 return [];
14233 }
14234 !ReactTestUtils.isCompositeComponent(inst) ? "development" !== 'production' ? invariant(false, 'findAllInRenderedTree(...): instance must be a composite component') : invariant(false) : undefined;
14235 return findAllInRenderedTreeInternal(ReactInstanceMap.get(inst), test);
14236 },
14237
14238 /**
14239 * Finds all instance of components in the rendered tree that are DOM
14240 * components with the class name matching `className`.
14241 * @return {array} an array of all the matches.
14242 */
14243 scryRenderedDOMComponentsWithClass: function (root, classNames) {
14244 if (!Array.isArray(classNames)) {
14245 classNames = classNames.split(/\s+/);
14246 }
14247 return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
14248 if (ReactTestUtils.isDOMComponent(inst)) {
14249 var className = inst.className;
14250 if (typeof className !== 'string') {
14251 // SVG, probably.
14252 className = inst.getAttribute('class') || '';
14253 }
14254 var classList = className.split(/\s+/);
14255 return classNames.every(function (name) {
14256 return classList.indexOf(name) !== -1;
14257 });
14258 }
14259 return false;
14260 });
14261 },
14262
14263 /**
14264 * Like scryRenderedDOMComponentsWithClass but expects there to be one result,
14265 * and returns that one result, or throws exception if there is any other
14266 * number of matches besides one.
14267 * @return {!ReactDOMComponent} The one match.
14268 */
14269 findRenderedDOMComponentWithClass: function (root, className) {
14270 var all = ReactTestUtils.scryRenderedDOMComponentsWithClass(root, className);
14271 if (all.length !== 1) {
14272 throw new Error('Did not find exactly one match ' + '(found: ' + all.length + ') for class:' + className);
14273 }
14274 return all[0];
14275 },
14276
14277 /**
14278 * Finds all instance of components in the rendered tree that are DOM
14279 * components with the tag name matching `tagName`.
14280 * @return {array} an array of all the matches.
14281 */
14282 scryRenderedDOMComponentsWithTag: function (root, tagName) {
14283 return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
14284 return ReactTestUtils.isDOMComponent(inst) && inst.tagName.toUpperCase() === tagName.toUpperCase();
14285 });
14286 },
14287
14288 /**
14289 * Like scryRenderedDOMComponentsWithTag but expects there to be one result,
14290 * and returns that one result, or throws exception if there is any other
14291 * number of matches besides one.
14292 * @return {!ReactDOMComponent} The one match.
14293 */
14294 findRenderedDOMComponentWithTag: function (root, tagName) {
14295 var all = ReactTestUtils.scryRenderedDOMComponentsWithTag(root, tagName);
14296 if (all.length !== 1) {
14297 throw new Error('Did not find exactly one match for tag:' + tagName);
14298 }
14299 return all[0];
14300 },
14301
14302 /**
14303 * Finds all instances of components with type equal to `componentType`.
14304 * @return {array} an array of all the matches.
14305 */
14306 scryRenderedComponentsWithType: function (root, componentType) {
14307 return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
14308 return ReactTestUtils.isCompositeComponentWithType(inst, componentType);
14309 });
14310 },
14311
14312 /**
14313 * Same as `scryRenderedComponentsWithType` but expects there to be one result
14314 * and returns that one result, or throws exception if there is any other
14315 * number of matches besides one.
14316 * @return {!ReactComponent} The one match.
14317 */
14318 findRenderedComponentWithType: function (root, componentType) {
14319 var all = ReactTestUtils.scryRenderedComponentsWithType(root, componentType);
14320 if (all.length !== 1) {
14321 throw new Error('Did not find exactly one match for componentType:' + componentType + ' (found ' + all.length + ')');
14322 }
14323 return all[0];
14324 },
14325
14326 /**
14327 * Pass a mocked component module to this method to augment it with
14328 * useful methods that allow it to be used as a dummy React component.
14329 * Instead of rendering as usual, the component will become a simple
14330 * <div> containing any provided children.
14331 *
14332 * @param {object} module the mock function object exported from a
14333 * module that defines the component to be mocked
14334 * @param {?string} mockTagName optional dummy root tag name to return
14335 * from render method (overrides
14336 * module.mockTagName if provided)
14337 * @return {object} the ReactTestUtils object (for chaining)
14338 */
14339 mockComponent: function (module, mockTagName) {
14340 mockTagName = mockTagName || module.mockTagName || 'div';
14341
14342 module.prototype.render.mockImplementation(function () {
14343 return React.createElement(mockTagName, null, this.props.children);
14344 });
14345
14346 return this;
14347 },
14348
14349 /**
14350 * Simulates a top level event being dispatched from a raw event that occurred
14351 * on an `Element` node.
14352 * @param {Object} topLevelType A type from `EventConstants.topLevelTypes`
14353 * @param {!Element} node The dom to simulate an event occurring on.
14354 * @param {?Event} fakeNativeEvent Fake native event to use in SyntheticEvent.
14355 */
14356 simulateNativeEventOnNode: function (topLevelType, node, fakeNativeEvent) {
14357 fakeNativeEvent.target = node;
14358 ReactBrowserEventEmitter.ReactEventListener.dispatchEvent(topLevelType, fakeNativeEvent);
14359 },
14360
14361 /**
14362 * Simulates a top level event being dispatched from a raw event that occurred
14363 * on the `ReactDOMComponent` `comp`.
14364 * @param {Object} topLevelType A type from `EventConstants.topLevelTypes`.
14365 * @param {!ReactDOMComponent} comp
14366 * @param {?Event} fakeNativeEvent Fake native event to use in SyntheticEvent.
14367 */
14368 simulateNativeEventOnDOMComponent: function (topLevelType, comp, fakeNativeEvent) {
14369 ReactTestUtils.simulateNativeEventOnNode(topLevelType, findDOMNode(comp), fakeNativeEvent);
14370 },
14371
14372 nativeTouchData: function (x, y) {
14373 return {
14374 touches: [{ pageX: x, pageY: y }]
14375 };
14376 },
14377
14378 createRenderer: function () {
14379 return new ReactShallowRenderer();
14380 },
14381
14382 Simulate: null,
14383 SimulateNative: {}
14384};
14385
14386/**
14387 * @class ReactShallowRenderer
14388 */
14389var ReactShallowRenderer = function () {
14390 this._instance = null;
14391};
14392
14393ReactShallowRenderer.prototype.getRenderOutput = function () {
14394 return this._instance && this._instance._renderedComponent && this._instance._renderedComponent._renderedOutput || null;
14395};
14396
14397var NoopInternalComponent = function (element) {
14398 this._renderedOutput = element;
14399 this._currentElement = element;
14400};
14401
14402NoopInternalComponent.prototype = {
14403
14404 mountComponent: function () {},
14405
14406 receiveComponent: function (element) {
14407 this._renderedOutput = element;
14408 this._currentElement = element;
14409 },
14410
14411 unmountComponent: function () {},
14412
14413 getPublicInstance: function () {
14414 return null;
14415 }
14416};
14417
14418var ShallowComponentWrapper = function () {};
14419assign(ShallowComponentWrapper.prototype, ReactCompositeComponent.Mixin, {
14420 _instantiateReactComponent: function (element) {
14421 return new NoopInternalComponent(element);
14422 },
14423 _replaceNodeWithMarkupByID: function () {},
14424 _renderValidatedComponent: ReactCompositeComponent.Mixin._renderValidatedComponentWithoutOwnerOrContext
14425});
14426
14427ReactShallowRenderer.prototype.render = function (element, context) {
14428 !ReactElement.isValidElement(element) ? "development" !== 'production' ? invariant(false, 'ReactShallowRenderer render(): Invalid component element.%s', typeof element === 'function' ? ' Instead of passing a component class, make sure to instantiate ' + 'it by passing it to React.createElement.' : '') : invariant(false) : undefined;
14429 !(typeof element.type !== 'string') ? "development" !== 'production' ? invariant(false, 'ReactShallowRenderer render(): Shallow rendering works only with custom ' + 'components, not primitives (%s). Instead of calling `.render(el)` and ' + 'inspecting the rendered output, look at `el.props` directly instead.', element.type) : invariant(false) : undefined;
14430
14431 if (!context) {
14432 context = emptyObject;
14433 }
14434 var transaction = ReactUpdates.ReactReconcileTransaction.getPooled(false);
14435 this._render(element, transaction, context);
14436 ReactUpdates.ReactReconcileTransaction.release(transaction);
14437};
14438
14439ReactShallowRenderer.prototype.unmount = function () {
14440 if (this._instance) {
14441 this._instance.unmountComponent();
14442 }
14443};
14444
14445ReactShallowRenderer.prototype._render = function (element, transaction, context) {
14446 if (this._instance) {
14447 this._instance.receiveComponent(element, transaction, context);
14448 } else {
14449 var rootID = ReactInstanceHandles.createReactRootID();
14450 var instance = new ShallowComponentWrapper(element.type);
14451 instance.construct(element);
14452
14453 instance.mountComponent(rootID, transaction, context);
14454
14455 this._instance = instance;
14456 }
14457};
14458
14459/**
14460 * Exports:
14461 *
14462 * - `ReactTestUtils.Simulate.click(Element/ReactDOMComponent)`
14463 * - `ReactTestUtils.Simulate.mouseMove(Element/ReactDOMComponent)`
14464 * - `ReactTestUtils.Simulate.change(Element/ReactDOMComponent)`
14465 * - ... (All keys from event plugin `eventTypes` objects)
14466 */
14467function makeSimulator(eventType) {
14468 return function (domComponentOrNode, eventData) {
14469 var node;
14470 if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {
14471 node = findDOMNode(domComponentOrNode);
14472 } else if (domComponentOrNode.tagName) {
14473 node = domComponentOrNode;
14474 }
14475
14476 var dispatchConfig = ReactBrowserEventEmitter.eventNameDispatchConfigs[eventType];
14477
14478 var fakeNativeEvent = new Event();
14479 fakeNativeEvent.target = node;
14480 // We don't use SyntheticEvent.getPooled in order to not have to worry about
14481 // properly destroying any properties assigned from `eventData` upon release
14482 var event = new SyntheticEvent(dispatchConfig, ReactMount.getID(node), fakeNativeEvent, node);
14483 assign(event, eventData);
14484
14485 if (dispatchConfig.phasedRegistrationNames) {
14486 EventPropagators.accumulateTwoPhaseDispatches(event);
14487 } else {
14488 EventPropagators.accumulateDirectDispatches(event);
14489 }
14490
14491 ReactUpdates.batchedUpdates(function () {
14492 EventPluginHub.enqueueEvents(event);
14493 EventPluginHub.processEventQueue(true);
14494 });
14495 };
14496}
14497
14498function buildSimulators() {
14499 ReactTestUtils.Simulate = {};
14500
14501 var eventType;
14502 for (eventType in ReactBrowserEventEmitter.eventNameDispatchConfigs) {
14503 /**
14504 * @param {!Element|ReactDOMComponent} domComponentOrNode
14505 * @param {?object} eventData Fake event data to use in SyntheticEvent.
14506 */
14507 ReactTestUtils.Simulate[eventType] = makeSimulator(eventType);
14508 }
14509}
14510
14511// Rebuild ReactTestUtils.Simulate whenever event plugins are injected
14512var oldInjectEventPluginOrder = EventPluginHub.injection.injectEventPluginOrder;
14513EventPluginHub.injection.injectEventPluginOrder = function () {
14514 oldInjectEventPluginOrder.apply(this, arguments);
14515 buildSimulators();
14516};
14517var oldInjectEventPlugins = EventPluginHub.injection.injectEventPluginsByName;
14518EventPluginHub.injection.injectEventPluginsByName = function () {
14519 oldInjectEventPlugins.apply(this, arguments);
14520 buildSimulators();
14521};
14522
14523buildSimulators();
14524
14525/**
14526 * Exports:
14527 *
14528 * - `ReactTestUtils.SimulateNative.click(Element/ReactDOMComponent)`
14529 * - `ReactTestUtils.SimulateNative.mouseMove(Element/ReactDOMComponent)`
14530 * - `ReactTestUtils.SimulateNative.mouseIn/ReactDOMComponent)`
14531 * - `ReactTestUtils.SimulateNative.mouseOut(Element/ReactDOMComponent)`
14532 * - ... (All keys from `EventConstants.topLevelTypes`)
14533 *
14534 * Note: Top level event types are a subset of the entire set of handler types
14535 * (which include a broader set of "synthetic" events). For example, onDragDone
14536 * is a synthetic event. Except when testing an event plugin or React's event
14537 * handling code specifically, you probably want to use ReactTestUtils.Simulate
14538 * to dispatch synthetic events.
14539 */
14540
14541function makeNativeSimulator(eventType) {
14542 return function (domComponentOrNode, nativeEventData) {
14543 var fakeNativeEvent = new Event(eventType);
14544 assign(fakeNativeEvent, nativeEventData);
14545 if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {
14546 ReactTestUtils.simulateNativeEventOnDOMComponent(eventType, domComponentOrNode, fakeNativeEvent);
14547 } else if (domComponentOrNode.tagName) {
14548 // Will allow on actual dom nodes.
14549 ReactTestUtils.simulateNativeEventOnNode(eventType, domComponentOrNode, fakeNativeEvent);
14550 }
14551 };
14552}
14553
14554Object.keys(topLevelTypes).forEach(function (eventType) {
14555 // Event type is stored as 'topClick' - we transform that to 'click'
14556 var convenienceName = eventType.indexOf('top') === 0 ? eventType.charAt(3).toLowerCase() + eventType.substr(4) : eventType;
14557 /**
14558 * @param {!Element|ReactDOMComponent} domComponentOrNode
14559 * @param {?Event} nativeEventData Fake native event to use in SyntheticEvent.
14560 */
14561 ReactTestUtils.SimulateNative[convenienceName] = makeNativeSimulator(eventType);
14562});
14563
14564module.exports = ReactTestUtils;
14565},{"105":105,"122":122,"15":15,"154":154,"16":16,"161":161,"19":19,"24":24,"26":26,"28":28,"38":38,"40":40,"57":57,"67":67,"68":68,"72":72,"96":96}],92:[function(_dereq_,module,exports){
14566/**
14567 * Copyright 2013-2015, Facebook, Inc.
14568 * All rights reserved.
14569 *
14570 * This source code is licensed under the BSD-style license found in the
14571 * LICENSE file in the root directory of this source tree. An additional grant
14572 * of patent rights can be found in the PATENTS file in the same directory.
14573 *
14574 * @typechecks static-only
14575 * @providesModule ReactTransitionChildMapping
14576 */
14577
14578'use strict';
14579
14580var flattenChildren = _dereq_(123);
14581
14582var ReactTransitionChildMapping = {
14583 /**
14584 * Given `this.props.children`, return an object mapping key to child. Just
14585 * simple syntactic sugar around flattenChildren().
14586 *
14587 * @param {*} children `this.props.children`
14588 * @return {object} Mapping of key to child
14589 */
14590 getChildMapping: function (children) {
14591 if (!children) {
14592 return children;
14593 }
14594 return flattenChildren(children);
14595 },
14596
14597 /**
14598 * When you're adding or removing children some may be added or removed in the
14599 * same render pass. We want to show *both* since we want to simultaneously
14600 * animate elements in and out. This function takes a previous set of keys
14601 * and a new set of keys and merges them with its best guess of the correct
14602 * ordering. In the future we may expose some of the utilities in
14603 * ReactMultiChild to make this easy, but for now React itself does not
14604 * directly have this concept of the union of prevChildren and nextChildren
14605 * so we implement it here.
14606 *
14607 * @param {object} prev prev children as returned from
14608 * `ReactTransitionChildMapping.getChildMapping()`.
14609 * @param {object} next next children as returned from
14610 * `ReactTransitionChildMapping.getChildMapping()`.
14611 * @return {object} a key set that contains all keys in `prev` and all keys
14612 * in `next` in a reasonable order.
14613 */
14614 mergeChildMappings: function (prev, next) {
14615 prev = prev || {};
14616 next = next || {};
14617
14618 function getValueForKey(key) {
14619 if (next.hasOwnProperty(key)) {
14620 return next[key];
14621 } else {
14622 return prev[key];
14623 }
14624 }
14625
14626 // For each key of `next`, the list of keys to insert before that key in
14627 // the combined list
14628 var nextKeysPending = {};
14629
14630 var pendingKeys = [];
14631 for (var prevKey in prev) {
14632 if (next.hasOwnProperty(prevKey)) {
14633 if (pendingKeys.length) {
14634 nextKeysPending[prevKey] = pendingKeys;
14635 pendingKeys = [];
14636 }
14637 } else {
14638 pendingKeys.push(prevKey);
14639 }
14640 }
14641
14642 var i;
14643 var childMapping = {};
14644 for (var nextKey in next) {
14645 if (nextKeysPending.hasOwnProperty(nextKey)) {
14646 for (i = 0; i < nextKeysPending[nextKey].length; i++) {
14647 var pendingNextKey = nextKeysPending[nextKey][i];
14648 childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
14649 }
14650 }
14651 childMapping[nextKey] = getValueForKey(nextKey);
14652 }
14653
14654 // Finally, add the keys which didn't appear before any key in `next`
14655 for (i = 0; i < pendingKeys.length; i++) {
14656 childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
14657 }
14658
14659 return childMapping;
14660 }
14661};
14662
14663module.exports = ReactTransitionChildMapping;
14664},{"123":123}],93:[function(_dereq_,module,exports){
14665/**
14666 * Copyright 2013-2015, Facebook, Inc.
14667 * All rights reserved.
14668 *
14669 * This source code is licensed under the BSD-style license found in the
14670 * LICENSE file in the root directory of this source tree. An additional grant
14671 * of patent rights can be found in the PATENTS file in the same directory.
14672 *
14673 * @providesModule ReactTransitionEvents
14674 */
14675
14676'use strict';
14677
14678var ExecutionEnvironment = _dereq_(147);
14679
14680/**
14681 * EVENT_NAME_MAP is used to determine which event fired when a
14682 * transition/animation ends, based on the style property used to
14683 * define that event.
14684 */
14685var EVENT_NAME_MAP = {
14686 transitionend: {
14687 'transition': 'transitionend',
14688 'WebkitTransition': 'webkitTransitionEnd',
14689 'MozTransition': 'mozTransitionEnd',
14690 'OTransition': 'oTransitionEnd',
14691 'msTransition': 'MSTransitionEnd'
14692 },
14693
14694 animationend: {
14695 'animation': 'animationend',
14696 'WebkitAnimation': 'webkitAnimationEnd',
14697 'MozAnimation': 'mozAnimationEnd',
14698 'OAnimation': 'oAnimationEnd',
14699 'msAnimation': 'MSAnimationEnd'
14700 }
14701};
14702
14703var endEvents = [];
14704
14705function detectEvents() {
14706 var testEl = document.createElement('div');
14707 var style = testEl.style;
14708
14709 // On some platforms, in particular some releases of Android 4.x,
14710 // the un-prefixed "animation" and "transition" properties are defined on the
14711 // style object but the events that fire will still be prefixed, so we need
14712 // to check if the un-prefixed events are useable, and if not remove them
14713 // from the map
14714 if (!('AnimationEvent' in window)) {
14715 delete EVENT_NAME_MAP.animationend.animation;
14716 }
14717
14718 if (!('TransitionEvent' in window)) {
14719 delete EVENT_NAME_MAP.transitionend.transition;
14720 }
14721
14722 for (var baseEventName in EVENT_NAME_MAP) {
14723 var baseEvents = EVENT_NAME_MAP[baseEventName];
14724 for (var styleName in baseEvents) {
14725 if (styleName in style) {
14726 endEvents.push(baseEvents[styleName]);
14727 break;
14728 }
14729 }
14730 }
14731}
14732
14733if (ExecutionEnvironment.canUseDOM) {
14734 detectEvents();
14735}
14736
14737// We use the raw {add|remove}EventListener() call because EventListener
14738// does not know how to remove event listeners and we really should
14739// clean up. Also, these events are not triggered in older browsers
14740// so we should be A-OK here.
14741
14742function addEventListener(node, eventName, eventListener) {
14743 node.addEventListener(eventName, eventListener, false);
14744}
14745
14746function removeEventListener(node, eventName, eventListener) {
14747 node.removeEventListener(eventName, eventListener, false);
14748}
14749
14750var ReactTransitionEvents = {
14751 addEndEventListener: function (node, eventListener) {
14752 if (endEvents.length === 0) {
14753 // If CSS transitions are not supported, trigger an "end animation"
14754 // event immediately.
14755 window.setTimeout(eventListener, 0);
14756 return;
14757 }
14758 endEvents.forEach(function (endEvent) {
14759 addEventListener(node, endEvent, eventListener);
14760 });
14761 },
14762
14763 removeEndEventListener: function (node, eventListener) {
14764 if (endEvents.length === 0) {
14765 return;
14766 }
14767 endEvents.forEach(function (endEvent) {
14768 removeEventListener(node, endEvent, eventListener);
14769 });
14770 }
14771};
14772
14773module.exports = ReactTransitionEvents;
14774},{"147":147}],94:[function(_dereq_,module,exports){
14775/**
14776 * Copyright 2013-2015, Facebook, Inc.
14777 * All rights reserved.
14778 *
14779 * This source code is licensed under the BSD-style license found in the
14780 * LICENSE file in the root directory of this source tree. An additional grant
14781 * of patent rights can be found in the PATENTS file in the same directory.
14782 *
14783 * @providesModule ReactTransitionGroup
14784 */
14785
14786'use strict';
14787
14788var React = _dereq_(26);
14789var ReactTransitionChildMapping = _dereq_(92);
14790
14791var assign = _dereq_(24);
14792var emptyFunction = _dereq_(153);
14793
14794var ReactTransitionGroup = React.createClass({
14795 displayName: 'ReactTransitionGroup',
14796
14797 propTypes: {
14798 component: React.PropTypes.any,
14799 childFactory: React.PropTypes.func
14800 },
14801
14802 getDefaultProps: function () {
14803 return {
14804 component: 'span',
14805 childFactory: emptyFunction.thatReturnsArgument
14806 };
14807 },
14808
14809 getInitialState: function () {
14810 return {
14811 children: ReactTransitionChildMapping.getChildMapping(this.props.children)
14812 };
14813 },
14814
14815 componentWillMount: function () {
14816 this.currentlyTransitioningKeys = {};
14817 this.keysToEnter = [];
14818 this.keysToLeave = [];
14819 },
14820
14821 componentDidMount: function () {
14822 var initialChildMapping = this.state.children;
14823 for (var key in initialChildMapping) {
14824 if (initialChildMapping[key]) {
14825 this.performAppear(key);
14826 }
14827 }
14828 },
14829
14830 componentWillReceiveProps: function (nextProps) {
14831 var nextChildMapping = ReactTransitionChildMapping.getChildMapping(nextProps.children);
14832 var prevChildMapping = this.state.children;
14833
14834 this.setState({
14835 children: ReactTransitionChildMapping.mergeChildMappings(prevChildMapping, nextChildMapping)
14836 });
14837
14838 var key;
14839
14840 for (key in nextChildMapping) {
14841 var hasPrev = prevChildMapping && prevChildMapping.hasOwnProperty(key);
14842 if (nextChildMapping[key] && !hasPrev && !this.currentlyTransitioningKeys[key]) {
14843 this.keysToEnter.push(key);
14844 }
14845 }
14846
14847 for (key in prevChildMapping) {
14848 var hasNext = nextChildMapping && nextChildMapping.hasOwnProperty(key);
14849 if (prevChildMapping[key] && !hasNext && !this.currentlyTransitioningKeys[key]) {
14850 this.keysToLeave.push(key);
14851 }
14852 }
14853
14854 // If we want to someday check for reordering, we could do it here.
14855 },
14856
14857 componentDidUpdate: function () {
14858 var keysToEnter = this.keysToEnter;
14859 this.keysToEnter = [];
14860 keysToEnter.forEach(this.performEnter);
14861
14862 var keysToLeave = this.keysToLeave;
14863 this.keysToLeave = [];
14864 keysToLeave.forEach(this.performLeave);
14865 },
14866
14867 performAppear: function (key) {
14868 this.currentlyTransitioningKeys[key] = true;
14869
14870 var component = this.refs[key];
14871
14872 if (component.componentWillAppear) {
14873 component.componentWillAppear(this._handleDoneAppearing.bind(this, key));
14874 } else {
14875 this._handleDoneAppearing(key);
14876 }
14877 },
14878
14879 _handleDoneAppearing: function (key) {
14880 var component = this.refs[key];
14881 if (component.componentDidAppear) {
14882 component.componentDidAppear();
14883 }
14884
14885 delete this.currentlyTransitioningKeys[key];
14886
14887 var currentChildMapping = ReactTransitionChildMapping.getChildMapping(this.props.children);
14888
14889 if (!currentChildMapping || !currentChildMapping.hasOwnProperty(key)) {
14890 // This was removed before it had fully appeared. Remove it.
14891 this.performLeave(key);
14892 }
14893 },
14894
14895 performEnter: function (key) {
14896 this.currentlyTransitioningKeys[key] = true;
14897
14898 var component = this.refs[key];
14899
14900 if (component.componentWillEnter) {
14901 component.componentWillEnter(this._handleDoneEntering.bind(this, key));
14902 } else {
14903 this._handleDoneEntering(key);
14904 }
14905 },
14906
14907 _handleDoneEntering: function (key) {
14908 var component = this.refs[key];
14909 if (component.componentDidEnter) {
14910 component.componentDidEnter();
14911 }
14912
14913 delete this.currentlyTransitioningKeys[key];
14914
14915 var currentChildMapping = ReactTransitionChildMapping.getChildMapping(this.props.children);
14916
14917 if (!currentChildMapping || !currentChildMapping.hasOwnProperty(key)) {
14918 // This was removed before it had fully entered. Remove it.
14919 this.performLeave(key);
14920 }
14921 },
14922
14923 performLeave: function (key) {
14924 this.currentlyTransitioningKeys[key] = true;
14925
14926 var component = this.refs[key];
14927 if (component.componentWillLeave) {
14928 component.componentWillLeave(this._handleDoneLeaving.bind(this, key));
14929 } else {
14930 // Note that this is somewhat dangerous b/c it calls setState()
14931 // again, effectively mutating the component before all the work
14932 // is done.
14933 this._handleDoneLeaving(key);
14934 }
14935 },
14936
14937 _handleDoneLeaving: function (key) {
14938 var component = this.refs[key];
14939
14940 if (component.componentDidLeave) {
14941 component.componentDidLeave();
14942 }
14943
14944 delete this.currentlyTransitioningKeys[key];
14945
14946 var currentChildMapping = ReactTransitionChildMapping.getChildMapping(this.props.children);
14947
14948 if (currentChildMapping && currentChildMapping.hasOwnProperty(key)) {
14949 // This entered again before it fully left. Add it again.
14950 this.performEnter(key);
14951 } else {
14952 this.setState(function (state) {
14953 var newChildren = assign({}, state.children);
14954 delete newChildren[key];
14955 return { children: newChildren };
14956 });
14957 }
14958 },
14959
14960 render: function () {
14961 // TODO: we could get rid of the need for the wrapper node
14962 // by cloning a single child
14963 var childrenToRender = [];
14964 for (var key in this.state.children) {
14965 var child = this.state.children[key];
14966 if (child) {
14967 // You may need to apply reactive updates to a child as it is leaving.
14968 // The normal React way to do it won't work since the child will have
14969 // already been removed. In case you need this behavior you can provide
14970 // a childFactory function to wrap every child, even the ones that are
14971 // leaving.
14972 childrenToRender.push(React.cloneElement(this.props.childFactory(child), { ref: key, key: key }));
14973 }
14974 }
14975 return React.createElement(this.props.component, this.props, childrenToRender);
14976 }
14977});
14978
14979module.exports = ReactTransitionGroup;
14980},{"153":153,"24":24,"26":26,"92":92}],95:[function(_dereq_,module,exports){
14981/**
14982 * Copyright 2015, Facebook, Inc.
14983 * All rights reserved.
14984 *
14985 * This source code is licensed under the BSD-style license found in the
14986 * LICENSE file in the root directory of this source tree. An additional grant
14987 * of patent rights can be found in the PATENTS file in the same directory.
14988 *
14989 * @providesModule ReactUpdateQueue
14990 */
14991
14992'use strict';
14993
14994var ReactCurrentOwner = _dereq_(39);
14995var ReactElement = _dereq_(57);
14996var ReactInstanceMap = _dereq_(68);
14997var ReactUpdates = _dereq_(96);
14998
14999var assign = _dereq_(24);
15000var invariant = _dereq_(161);
15001var warning = _dereq_(173);
15002
15003function enqueueUpdate(internalInstance) {
15004 ReactUpdates.enqueueUpdate(internalInstance);
15005}
15006
15007function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
15008 var internalInstance = ReactInstanceMap.get(publicInstance);
15009 if (!internalInstance) {
15010 if ("development" !== 'production') {
15011 // Only warn when we have a callerName. Otherwise we should be silent.
15012 // We're probably calling from enqueueCallback. We don't want to warn
15013 // there because we already warned for the corresponding lifecycle method.
15014 "development" !== 'production' ? warning(!callerName, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, publicInstance.constructor.displayName) : undefined;
15015 }
15016 return null;
15017 }
15018
15019 if ("development" !== 'production') {
15020 "development" !== 'production' ? warning(ReactCurrentOwner.current == null, '%s(...): Cannot update during an existing state transition ' + '(such as within `render`). Render methods should be a pure function ' + 'of props and state.', callerName) : undefined;
15021 }
15022
15023 return internalInstance;
15024}
15025
15026/**
15027 * ReactUpdateQueue allows for state updates to be scheduled into a later
15028 * reconciliation step.
15029 */
15030var ReactUpdateQueue = {
15031
15032 /**
15033 * Checks whether or not this composite component is mounted.
15034 * @param {ReactClass} publicInstance The instance we want to test.
15035 * @return {boolean} True if mounted, false otherwise.
15036 * @protected
15037 * @final
15038 */
15039 isMounted: function (publicInstance) {
15040 if ("development" !== 'production') {
15041 var owner = ReactCurrentOwner.current;
15042 if (owner !== null) {
15043 "development" !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : undefined;
15044 owner._warnedAboutRefsInRender = true;
15045 }
15046 }
15047 var internalInstance = ReactInstanceMap.get(publicInstance);
15048 if (internalInstance) {
15049 // During componentWillMount and render this will still be null but after
15050 // that will always render to something. At least for now. So we can use
15051 // this hack.
15052 return !!internalInstance._renderedComponent;
15053 } else {
15054 return false;
15055 }
15056 },
15057
15058 /**
15059 * Enqueue a callback that will be executed after all the pending updates
15060 * have processed.
15061 *
15062 * @param {ReactClass} publicInstance The instance to use as `this` context.
15063 * @param {?function} callback Called after state is updated.
15064 * @internal
15065 */
15066 enqueueCallback: function (publicInstance, callback) {
15067 !(typeof callback === 'function') ? "development" !== 'production' ? invariant(false, 'enqueueCallback(...): You called `setProps`, `replaceProps`, ' + '`setState`, `replaceState`, or `forceUpdate` with a callback that ' + 'isn\'t callable.') : invariant(false) : undefined;
15068 var internalInstance = getInternalInstanceReadyForUpdate(publicInstance);
15069
15070 // Previously we would throw an error if we didn't have an internal
15071 // instance. Since we want to make it a no-op instead, we mirror the same
15072 // behavior we have in other enqueue* methods.
15073 // We also need to ignore callbacks in componentWillMount. See
15074 // enqueueUpdates.
15075 if (!internalInstance) {
15076 return null;
15077 }
15078
15079 if (internalInstance._pendingCallbacks) {
15080 internalInstance._pendingCallbacks.push(callback);
15081 } else {
15082 internalInstance._pendingCallbacks = [callback];
15083 }
15084 // TODO: The callback here is ignored when setState is called from
15085 // componentWillMount. Either fix it or disallow doing so completely in
15086 // favor of getInitialState. Alternatively, we can disallow
15087 // componentWillMount during server-side rendering.
15088 enqueueUpdate(internalInstance);
15089 },
15090
15091 enqueueCallbackInternal: function (internalInstance, callback) {
15092 !(typeof callback === 'function') ? "development" !== 'production' ? invariant(false, 'enqueueCallback(...): You called `setProps`, `replaceProps`, ' + '`setState`, `replaceState`, or `forceUpdate` with a callback that ' + 'isn\'t callable.') : invariant(false) : undefined;
15093 if (internalInstance._pendingCallbacks) {
15094 internalInstance._pendingCallbacks.push(callback);
15095 } else {
15096 internalInstance._pendingCallbacks = [callback];
15097 }
15098 enqueueUpdate(internalInstance);
15099 },
15100
15101 /**
15102 * Forces an update. This should only be invoked when it is known with
15103 * certainty that we are **not** in a DOM transaction.
15104 *
15105 * You may want to call this when you know that some deeper aspect of the
15106 * component's state has changed but `setState` was not called.
15107 *
15108 * This will not invoke `shouldComponentUpdate`, but it will invoke
15109 * `componentWillUpdate` and `componentDidUpdate`.
15110 *
15111 * @param {ReactClass} publicInstance The instance that should rerender.
15112 * @internal
15113 */
15114 enqueueForceUpdate: function (publicInstance) {
15115 var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'forceUpdate');
15116
15117 if (!internalInstance) {
15118 return;
15119 }
15120
15121 internalInstance._pendingForceUpdate = true;
15122
15123 enqueueUpdate(internalInstance);
15124 },
15125
15126 /**
15127 * Replaces all of the state. Always use this or `setState` to mutate state.
15128 * You should treat `this.state` as immutable.
15129 *
15130 * There is no guarantee that `this.state` will be immediately updated, so
15131 * accessing `this.state` after calling this method may return the old value.
15132 *
15133 * @param {ReactClass} publicInstance The instance that should rerender.
15134 * @param {object} completeState Next state.
15135 * @internal
15136 */
15137 enqueueReplaceState: function (publicInstance, completeState) {
15138 var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceState');
15139
15140 if (!internalInstance) {
15141 return;
15142 }
15143
15144 internalInstance._pendingStateQueue = [completeState];
15145 internalInstance._pendingReplaceState = true;
15146
15147 enqueueUpdate(internalInstance);
15148 },
15149
15150 /**
15151 * Sets a subset of the state. This only exists because _pendingState is
15152 * internal. This provides a merging strategy that is not available to deep
15153 * properties which is confusing. TODO: Expose pendingState or don't use it
15154 * during the merge.
15155 *
15156 * @param {ReactClass} publicInstance The instance that should rerender.
15157 * @param {object} partialState Next partial state to be merged with state.
15158 * @internal
15159 */
15160 enqueueSetState: function (publicInstance, partialState) {
15161 var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'setState');
15162
15163 if (!internalInstance) {
15164 return;
15165 }
15166
15167 var queue = internalInstance._pendingStateQueue || (internalInstance._pendingStateQueue = []);
15168 queue.push(partialState);
15169
15170 enqueueUpdate(internalInstance);
15171 },
15172
15173 /**
15174 * Sets a subset of the props.
15175 *
15176 * @param {ReactClass} publicInstance The instance that should rerender.
15177 * @param {object} partialProps Subset of the next props.
15178 * @internal
15179 */
15180 enqueueSetProps: function (publicInstance, partialProps) {
15181 var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'setProps');
15182 if (!internalInstance) {
15183 return;
15184 }
15185 ReactUpdateQueue.enqueueSetPropsInternal(internalInstance, partialProps);
15186 },
15187
15188 enqueueSetPropsInternal: function (internalInstance, partialProps) {
15189 var topLevelWrapper = internalInstance._topLevelWrapper;
15190 !topLevelWrapper ? "development" !== 'production' ? invariant(false, 'setProps(...): You called `setProps` on a ' + 'component with a parent. This is an anti-pattern since props will ' + 'get reactively updated when rendered. Instead, change the owner\'s ' + '`render` method to pass the correct value as props to the component ' + 'where it is created.') : invariant(false) : undefined;
15191
15192 // Merge with the pending element if it exists, otherwise with existing
15193 // element props.
15194 var wrapElement = topLevelWrapper._pendingElement || topLevelWrapper._currentElement;
15195 var element = wrapElement.props;
15196 var props = assign({}, element.props, partialProps);
15197 topLevelWrapper._pendingElement = ReactElement.cloneAndReplaceProps(wrapElement, ReactElement.cloneAndReplaceProps(element, props));
15198
15199 enqueueUpdate(topLevelWrapper);
15200 },
15201
15202 /**
15203 * Replaces all of the props.
15204 *
15205 * @param {ReactClass} publicInstance The instance that should rerender.
15206 * @param {object} props New props.
15207 * @internal
15208 */
15209 enqueueReplaceProps: function (publicInstance, props) {
15210 var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceProps');
15211 if (!internalInstance) {
15212 return;
15213 }
15214 ReactUpdateQueue.enqueueReplacePropsInternal(internalInstance, props);
15215 },
15216
15217 enqueueReplacePropsInternal: function (internalInstance, props) {
15218 var topLevelWrapper = internalInstance._topLevelWrapper;
15219 !topLevelWrapper ? "development" !== 'production' ? invariant(false, 'replaceProps(...): You called `replaceProps` on a ' + 'component with a parent. This is an anti-pattern since props will ' + 'get reactively updated when rendered. Instead, change the owner\'s ' + '`render` method to pass the correct value as props to the component ' + 'where it is created.') : invariant(false) : undefined;
15220
15221 // Merge with the pending element if it exists, otherwise with existing
15222 // element props.
15223 var wrapElement = topLevelWrapper._pendingElement || topLevelWrapper._currentElement;
15224 var element = wrapElement.props;
15225 topLevelWrapper._pendingElement = ReactElement.cloneAndReplaceProps(wrapElement, ReactElement.cloneAndReplaceProps(element, props));
15226
15227 enqueueUpdate(topLevelWrapper);
15228 },
15229
15230 enqueueElementInternal: function (internalInstance, newElement) {
15231 internalInstance._pendingElement = newElement;
15232 enqueueUpdate(internalInstance);
15233 }
15234
15235};
15236
15237module.exports = ReactUpdateQueue;
15238},{"161":161,"173":173,"24":24,"39":39,"57":57,"68":68,"96":96}],96:[function(_dereq_,module,exports){
15239/**
15240 * Copyright 2013-2015, Facebook, Inc.
15241 * All rights reserved.
15242 *
15243 * This source code is licensed under the BSD-style license found in the
15244 * LICENSE file in the root directory of this source tree. An additional grant
15245 * of patent rights can be found in the PATENTS file in the same directory.
15246 *
15247 * @providesModule ReactUpdates
15248 */
15249
15250'use strict';
15251
15252var CallbackQueue = _dereq_(6);
15253var PooledClass = _dereq_(25);
15254var ReactPerf = _dereq_(78);
15255var ReactReconciler = _dereq_(84);
15256var Transaction = _dereq_(113);
15257
15258var assign = _dereq_(24);
15259var invariant = _dereq_(161);
15260
15261var dirtyComponents = [];
15262var asapCallbackQueue = CallbackQueue.getPooled();
15263var asapEnqueued = false;
15264
15265var batchingStrategy = null;
15266
15267function ensureInjected() {
15268 !(ReactUpdates.ReactReconcileTransaction && batchingStrategy) ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must inject a reconcile transaction class and batching ' + 'strategy') : invariant(false) : undefined;
15269}
15270
15271var NESTED_UPDATES = {
15272 initialize: function () {
15273 this.dirtyComponentsLength = dirtyComponents.length;
15274 },
15275 close: function () {
15276 if (this.dirtyComponentsLength !== dirtyComponents.length) {
15277 // Additional updates were enqueued by componentDidUpdate handlers or
15278 // similar; before our own UPDATE_QUEUEING wrapper closes, we want to run
15279 // these new updates so that if A's componentDidUpdate calls setState on
15280 // B, B will update before the callback A's updater provided when calling
15281 // setState.
15282 dirtyComponents.splice(0, this.dirtyComponentsLength);
15283 flushBatchedUpdates();
15284 } else {
15285 dirtyComponents.length = 0;
15286 }
15287 }
15288};
15289
15290var UPDATE_QUEUEING = {
15291 initialize: function () {
15292 this.callbackQueue.reset();
15293 },
15294 close: function () {
15295 this.callbackQueue.notifyAll();
15296 }
15297};
15298
15299var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING];
15300
15301function ReactUpdatesFlushTransaction() {
15302 this.reinitializeTransaction();
15303 this.dirtyComponentsLength = null;
15304 this.callbackQueue = CallbackQueue.getPooled();
15305 this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled( /* forceHTML */false);
15306}
15307
15308assign(ReactUpdatesFlushTransaction.prototype, Transaction.Mixin, {
15309 getTransactionWrappers: function () {
15310 return TRANSACTION_WRAPPERS;
15311 },
15312
15313 destructor: function () {
15314 this.dirtyComponentsLength = null;
15315 CallbackQueue.release(this.callbackQueue);
15316 this.callbackQueue = null;
15317 ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction);
15318 this.reconcileTransaction = null;
15319 },
15320
15321 perform: function (method, scope, a) {
15322 // Essentially calls `this.reconcileTransaction.perform(method, scope, a)`
15323 // with this transaction's wrappers around it.
15324 return Transaction.Mixin.perform.call(this, this.reconcileTransaction.perform, this.reconcileTransaction, method, scope, a);
15325 }
15326});
15327
15328PooledClass.addPoolingTo(ReactUpdatesFlushTransaction);
15329
15330function batchedUpdates(callback, a, b, c, d, e) {
15331 ensureInjected();
15332 batchingStrategy.batchedUpdates(callback, a, b, c, d, e);
15333}
15334
15335/**
15336 * Array comparator for ReactComponents by mount ordering.
15337 *
15338 * @param {ReactComponent} c1 first component you're comparing
15339 * @param {ReactComponent} c2 second component you're comparing
15340 * @return {number} Return value usable by Array.prototype.sort().
15341 */
15342function mountOrderComparator(c1, c2) {
15343 return c1._mountOrder - c2._mountOrder;
15344}
15345
15346function runBatchedUpdates(transaction) {
15347 var len = transaction.dirtyComponentsLength;
15348 !(len === dirtyComponents.length) ? "development" !== 'production' ? invariant(false, 'Expected flush transaction\'s stored dirty-components length (%s) to ' + 'match dirty-components array length (%s).', len, dirtyComponents.length) : invariant(false) : undefined;
15349
15350 // Since reconciling a component higher in the owner hierarchy usually (not
15351 // always -- see shouldComponentUpdate()) will reconcile children, reconcile
15352 // them before their children by sorting the array.
15353 dirtyComponents.sort(mountOrderComparator);
15354
15355 for (var i = 0; i < len; i++) {
15356 // If a component is unmounted before pending changes apply, it will still
15357 // be here, but we assume that it has cleared its _pendingCallbacks and
15358 // that performUpdateIfNecessary is a noop.
15359 var component = dirtyComponents[i];
15360
15361 // If performUpdateIfNecessary happens to enqueue any new updates, we
15362 // shouldn't execute the callbacks until the next render happens, so
15363 // stash the callbacks first
15364 var callbacks = component._pendingCallbacks;
15365 component._pendingCallbacks = null;
15366
15367 ReactReconciler.performUpdateIfNecessary(component, transaction.reconcileTransaction);
15368
15369 if (callbacks) {
15370 for (var j = 0; j < callbacks.length; j++) {
15371 transaction.callbackQueue.enqueue(callbacks[j], component.getPublicInstance());
15372 }
15373 }
15374 }
15375}
15376
15377var flushBatchedUpdates = function () {
15378 // ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents
15379 // array and perform any updates enqueued by mount-ready handlers (i.e.,
15380 // componentDidUpdate) but we need to check here too in order to catch
15381 // updates enqueued by setState callbacks and asap calls.
15382 while (dirtyComponents.length || asapEnqueued) {
15383 if (dirtyComponents.length) {
15384 var transaction = ReactUpdatesFlushTransaction.getPooled();
15385 transaction.perform(runBatchedUpdates, null, transaction);
15386 ReactUpdatesFlushTransaction.release(transaction);
15387 }
15388
15389 if (asapEnqueued) {
15390 asapEnqueued = false;
15391 var queue = asapCallbackQueue;
15392 asapCallbackQueue = CallbackQueue.getPooled();
15393 queue.notifyAll();
15394 CallbackQueue.release(queue);
15395 }
15396 }
15397};
15398flushBatchedUpdates = ReactPerf.measure('ReactUpdates', 'flushBatchedUpdates', flushBatchedUpdates);
15399
15400/**
15401 * Mark a component as needing a rerender, adding an optional callback to a
15402 * list of functions which will be executed once the rerender occurs.
15403 */
15404function enqueueUpdate(component) {
15405 ensureInjected();
15406
15407 // Various parts of our code (such as ReactCompositeComponent's
15408 // _renderValidatedComponent) assume that calls to render aren't nested;
15409 // verify that that's the case. (This is called by each top-level update
15410 // function, like setProps, setState, forceUpdate, etc.; creation and
15411 // destruction of top-level components is guarded in ReactMount.)
15412
15413 if (!batchingStrategy.isBatchingUpdates) {
15414 batchingStrategy.batchedUpdates(enqueueUpdate, component);
15415 return;
15416 }
15417
15418 dirtyComponents.push(component);
15419}
15420
15421/**
15422 * Enqueue a callback to be run at the end of the current batching cycle. Throws
15423 * if no updates are currently being performed.
15424 */
15425function asap(callback, context) {
15426 !batchingStrategy.isBatchingUpdates ? "development" !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;
15427 asapCallbackQueue.enqueue(callback, context);
15428 asapEnqueued = true;
15429}
15430
15431var ReactUpdatesInjection = {
15432 injectReconcileTransaction: function (ReconcileTransaction) {
15433 !ReconcileTransaction ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must provide a reconcile transaction class') : invariant(false) : undefined;
15434 ReactUpdates.ReactReconcileTransaction = ReconcileTransaction;
15435 },
15436
15437 injectBatchingStrategy: function (_batchingStrategy) {
15438 !_batchingStrategy ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must provide a batching strategy') : invariant(false) : undefined;
15439 !(typeof _batchingStrategy.batchedUpdates === 'function') ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must provide a batchedUpdates() function') : invariant(false) : undefined;
15440 !(typeof _batchingStrategy.isBatchingUpdates === 'boolean') ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must provide an isBatchingUpdates boolean attribute') : invariant(false) : undefined;
15441 batchingStrategy = _batchingStrategy;
15442 }
15443};
15444
15445var ReactUpdates = {
15446 /**
15447 * React references `ReactReconcileTransaction` using this property in order
15448 * to allow dependency injection.
15449 *
15450 * @internal
15451 */
15452 ReactReconcileTransaction: null,
15453
15454 batchedUpdates: batchedUpdates,
15455 enqueueUpdate: enqueueUpdate,
15456 flushBatchedUpdates: flushBatchedUpdates,
15457 injection: ReactUpdatesInjection,
15458 asap: asap
15459};
15460
15461module.exports = ReactUpdates;
15462},{"113":113,"161":161,"24":24,"25":25,"6":6,"78":78,"84":84}],97:[function(_dereq_,module,exports){
15463/**
15464 * Copyright 2013-2015, Facebook, Inc.
15465 * All rights reserved.
15466 *
15467 * This source code is licensed under the BSD-style license found in the
15468 * LICENSE file in the root directory of this source tree. An additional grant
15469 * of patent rights can be found in the PATENTS file in the same directory.
15470 *
15471 * @providesModule ReactVersion
15472 */
15473
15474'use strict';
15475
15476module.exports = '0.14.3';
15477},{}],98:[function(_dereq_,module,exports){
15478/**
15479 * Copyright 2013-2015, Facebook, Inc.
15480 * All rights reserved.
15481 *
15482 * This source code is licensed under the BSD-style license found in the
15483 * LICENSE file in the root directory of this source tree. An additional grant
15484 * of patent rights can be found in the PATENTS file in the same directory.
15485 *
15486 * @providesModule SVGDOMPropertyConfig
15487 */
15488
15489'use strict';
15490
15491var DOMProperty = _dereq_(10);
15492
15493var MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE;
15494
15495var NS = {
15496 xlink: 'http://www.w3.org/1999/xlink',
15497 xml: 'http://www.w3.org/XML/1998/namespace'
15498};
15499
15500var SVGDOMPropertyConfig = {
15501 Properties: {
15502 clipPath: MUST_USE_ATTRIBUTE,
15503 cx: MUST_USE_ATTRIBUTE,
15504 cy: MUST_USE_ATTRIBUTE,
15505 d: MUST_USE_ATTRIBUTE,
15506 dx: MUST_USE_ATTRIBUTE,
15507 dy: MUST_USE_ATTRIBUTE,
15508 fill: MUST_USE_ATTRIBUTE,
15509 fillOpacity: MUST_USE_ATTRIBUTE,
15510 fontFamily: MUST_USE_ATTRIBUTE,
15511 fontSize: MUST_USE_ATTRIBUTE,
15512 fx: MUST_USE_ATTRIBUTE,
15513 fy: MUST_USE_ATTRIBUTE,
15514 gradientTransform: MUST_USE_ATTRIBUTE,
15515 gradientUnits: MUST_USE_ATTRIBUTE,
15516 markerEnd: MUST_USE_ATTRIBUTE,
15517 markerMid: MUST_USE_ATTRIBUTE,
15518 markerStart: MUST_USE_ATTRIBUTE,
15519 offset: MUST_USE_ATTRIBUTE,
15520 opacity: MUST_USE_ATTRIBUTE,
15521 patternContentUnits: MUST_USE_ATTRIBUTE,
15522 patternUnits: MUST_USE_ATTRIBUTE,
15523 points: MUST_USE_ATTRIBUTE,
15524 preserveAspectRatio: MUST_USE_ATTRIBUTE,
15525 r: MUST_USE_ATTRIBUTE,
15526 rx: MUST_USE_ATTRIBUTE,
15527 ry: MUST_USE_ATTRIBUTE,
15528 spreadMethod: MUST_USE_ATTRIBUTE,
15529 stopColor: MUST_USE_ATTRIBUTE,
15530 stopOpacity: MUST_USE_ATTRIBUTE,
15531 stroke: MUST_USE_ATTRIBUTE,
15532 strokeDasharray: MUST_USE_ATTRIBUTE,
15533 strokeLinecap: MUST_USE_ATTRIBUTE,
15534 strokeOpacity: MUST_USE_ATTRIBUTE,
15535 strokeWidth: MUST_USE_ATTRIBUTE,
15536 textAnchor: MUST_USE_ATTRIBUTE,
15537 transform: MUST_USE_ATTRIBUTE,
15538 version: MUST_USE_ATTRIBUTE,
15539 viewBox: MUST_USE_ATTRIBUTE,
15540 x1: MUST_USE_ATTRIBUTE,
15541 x2: MUST_USE_ATTRIBUTE,
15542 x: MUST_USE_ATTRIBUTE,
15543 xlinkActuate: MUST_USE_ATTRIBUTE,
15544 xlinkArcrole: MUST_USE_ATTRIBUTE,
15545 xlinkHref: MUST_USE_ATTRIBUTE,
15546 xlinkRole: MUST_USE_ATTRIBUTE,
15547 xlinkShow: MUST_USE_ATTRIBUTE,
15548 xlinkTitle: MUST_USE_ATTRIBUTE,
15549 xlinkType: MUST_USE_ATTRIBUTE,
15550 xmlBase: MUST_USE_ATTRIBUTE,
15551 xmlLang: MUST_USE_ATTRIBUTE,
15552 xmlSpace: MUST_USE_ATTRIBUTE,
15553 y1: MUST_USE_ATTRIBUTE,
15554 y2: MUST_USE_ATTRIBUTE,
15555 y: MUST_USE_ATTRIBUTE
15556 },
15557 DOMAttributeNamespaces: {
15558 xlinkActuate: NS.xlink,
15559 xlinkArcrole: NS.xlink,
15560 xlinkHref: NS.xlink,
15561 xlinkRole: NS.xlink,
15562 xlinkShow: NS.xlink,
15563 xlinkTitle: NS.xlink,
15564 xlinkType: NS.xlink,
15565 xmlBase: NS.xml,
15566 xmlLang: NS.xml,
15567 xmlSpace: NS.xml
15568 },
15569 DOMAttributeNames: {
15570 clipPath: 'clip-path',
15571 fillOpacity: 'fill-opacity',
15572 fontFamily: 'font-family',
15573 fontSize: 'font-size',
15574 gradientTransform: 'gradientTransform',
15575 gradientUnits: 'gradientUnits',
15576 markerEnd: 'marker-end',
15577 markerMid: 'marker-mid',
15578 markerStart: 'marker-start',
15579 patternContentUnits: 'patternContentUnits',
15580 patternUnits: 'patternUnits',
15581 preserveAspectRatio: 'preserveAspectRatio',
15582 spreadMethod: 'spreadMethod',
15583 stopColor: 'stop-color',
15584 stopOpacity: 'stop-opacity',
15585 strokeDasharray: 'stroke-dasharray',
15586 strokeLinecap: 'stroke-linecap',
15587 strokeOpacity: 'stroke-opacity',
15588 strokeWidth: 'stroke-width',
15589 textAnchor: 'text-anchor',
15590 viewBox: 'viewBox',
15591 xlinkActuate: 'xlink:actuate',
15592 xlinkArcrole: 'xlink:arcrole',
15593 xlinkHref: 'xlink:href',
15594 xlinkRole: 'xlink:role',
15595 xlinkShow: 'xlink:show',
15596 xlinkTitle: 'xlink:title',
15597 xlinkType: 'xlink:type',
15598 xmlBase: 'xml:base',
15599 xmlLang: 'xml:lang',
15600 xmlSpace: 'xml:space'
15601 }
15602};
15603
15604module.exports = SVGDOMPropertyConfig;
15605},{"10":10}],99:[function(_dereq_,module,exports){
15606/**
15607 * Copyright 2013-2015, Facebook, Inc.
15608 * All rights reserved.
15609 *
15610 * This source code is licensed under the BSD-style license found in the
15611 * LICENSE file in the root directory of this source tree. An additional grant
15612 * of patent rights can be found in the PATENTS file in the same directory.
15613 *
15614 * @providesModule SelectEventPlugin
15615 */
15616
15617'use strict';
15618
15619var EventConstants = _dereq_(15);
15620var EventPropagators = _dereq_(19);
15621var ExecutionEnvironment = _dereq_(147);
15622var ReactInputSelection = _dereq_(66);
15623var SyntheticEvent = _dereq_(105);
15624
15625var getActiveElement = _dereq_(156);
15626var isTextInputElement = _dereq_(134);
15627var keyOf = _dereq_(166);
15628var shallowEqual = _dereq_(171);
15629
15630var topLevelTypes = EventConstants.topLevelTypes;
15631
15632var skipSelectionChangeEvent = ExecutionEnvironment.canUseDOM && 'documentMode' in document && document.documentMode <= 11;
15633
15634var eventTypes = {
15635 select: {
15636 phasedRegistrationNames: {
15637 bubbled: keyOf({ onSelect: null }),
15638 captured: keyOf({ onSelectCapture: null })
15639 },
15640 dependencies: [topLevelTypes.topBlur, topLevelTypes.topContextMenu, topLevelTypes.topFocus, topLevelTypes.topKeyDown, topLevelTypes.topMouseDown, topLevelTypes.topMouseUp, topLevelTypes.topSelectionChange]
15641 }
15642};
15643
15644var activeElement = null;
15645var activeElementID = null;
15646var lastSelection = null;
15647var mouseDown = false;
15648
15649// Track whether a listener exists for this plugin. If none exist, we do
15650// not extract events.
15651var hasListener = false;
15652var ON_SELECT_KEY = keyOf({ onSelect: null });
15653
15654/**
15655 * Get an object which is a unique representation of the current selection.
15656 *
15657 * The return value will not be consistent across nodes or browsers, but
15658 * two identical selections on the same node will return identical objects.
15659 *
15660 * @param {DOMElement} node
15661 * @return {object}
15662 */
15663function getSelection(node) {
15664 if ('selectionStart' in node && ReactInputSelection.hasSelectionCapabilities(node)) {
15665 return {
15666 start: node.selectionStart,
15667 end: node.selectionEnd
15668 };
15669 } else if (window.getSelection) {
15670 var selection = window.getSelection();
15671 return {
15672 anchorNode: selection.anchorNode,
15673 anchorOffset: selection.anchorOffset,
15674 focusNode: selection.focusNode,
15675 focusOffset: selection.focusOffset
15676 };
15677 } else if (document.selection) {
15678 var range = document.selection.createRange();
15679 return {
15680 parentElement: range.parentElement(),
15681 text: range.text,
15682 top: range.boundingTop,
15683 left: range.boundingLeft
15684 };
15685 }
15686}
15687
15688/**
15689 * Poll selection to see whether it's changed.
15690 *
15691 * @param {object} nativeEvent
15692 * @return {?SyntheticEvent}
15693 */
15694function constructSelectEvent(nativeEvent, nativeEventTarget) {
15695 // Ensure we have the right element, and that the user is not dragging a
15696 // selection (this matches native `select` event behavior). In HTML5, select
15697 // fires only on input and textarea thus if there's no focused element we
15698 // won't dispatch.
15699 if (mouseDown || activeElement == null || activeElement !== getActiveElement()) {
15700 return null;
15701 }
15702
15703 // Only fire when selection has actually changed.
15704 var currentSelection = getSelection(activeElement);
15705 if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
15706 lastSelection = currentSelection;
15707
15708 var syntheticEvent = SyntheticEvent.getPooled(eventTypes.select, activeElementID, nativeEvent, nativeEventTarget);
15709
15710 syntheticEvent.type = 'select';
15711 syntheticEvent.target = activeElement;
15712
15713 EventPropagators.accumulateTwoPhaseDispatches(syntheticEvent);
15714
15715 return syntheticEvent;
15716 }
15717
15718 return null;
15719}
15720
15721/**
15722 * This plugin creates an `onSelect` event that normalizes select events
15723 * across form elements.
15724 *
15725 * Supported elements are:
15726 * - input (see `isTextInputElement`)
15727 * - textarea
15728 * - contentEditable
15729 *
15730 * This differs from native browser implementations in the following ways:
15731 * - Fires on contentEditable fields as well as inputs.
15732 * - Fires for collapsed selection.
15733 * - Fires after user input.
15734 */
15735var SelectEventPlugin = {
15736
15737 eventTypes: eventTypes,
15738
15739 /**
15740 * @param {string} topLevelType Record from `EventConstants`.
15741 * @param {DOMEventTarget} topLevelTarget The listening component root node.
15742 * @param {string} topLevelTargetID ID of `topLevelTarget`.
15743 * @param {object} nativeEvent Native browser event.
15744 * @return {*} An accumulation of synthetic events.
15745 * @see {EventPluginHub.extractEvents}
15746 */
15747 extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
15748 if (!hasListener) {
15749 return null;
15750 }
15751
15752 switch (topLevelType) {
15753 // Track the input node that has focus.
15754 case topLevelTypes.topFocus:
15755 if (isTextInputElement(topLevelTarget) || topLevelTarget.contentEditable === 'true') {
15756 activeElement = topLevelTarget;
15757 activeElementID = topLevelTargetID;
15758 lastSelection = null;
15759 }
15760 break;
15761 case topLevelTypes.topBlur:
15762 activeElement = null;
15763 activeElementID = null;
15764 lastSelection = null;
15765 break;
15766
15767 // Don't fire the event while the user is dragging. This matches the
15768 // semantics of the native select event.
15769 case topLevelTypes.topMouseDown:
15770 mouseDown = true;
15771 break;
15772 case topLevelTypes.topContextMenu:
15773 case topLevelTypes.topMouseUp:
15774 mouseDown = false;
15775 return constructSelectEvent(nativeEvent, nativeEventTarget);
15776
15777 // Chrome and IE fire non-standard event when selection is changed (and
15778 // sometimes when it hasn't). IE's event fires out of order with respect
15779 // to key and input events on deletion, so we discard it.
15780 //
15781 // Firefox doesn't support selectionchange, so check selection status
15782 // after each key entry. The selection changes after keydown and before
15783 // keyup, but we check on keydown as well in the case of holding down a
15784 // key, when multiple keydown events are fired but only one keyup is.
15785 // This is also our approach for IE handling, for the reason above.
15786 case topLevelTypes.topSelectionChange:
15787 if (skipSelectionChangeEvent) {
15788 break;
15789 }
15790 // falls through
15791 case topLevelTypes.topKeyDown:
15792 case topLevelTypes.topKeyUp:
15793 return constructSelectEvent(nativeEvent, nativeEventTarget);
15794 }
15795
15796 return null;
15797 },
15798
15799 didPutListener: function (id, registrationName, listener) {
15800 if (registrationName === ON_SELECT_KEY) {
15801 hasListener = true;
15802 }
15803 }
15804};
15805
15806module.exports = SelectEventPlugin;
15807},{"105":105,"134":134,"147":147,"15":15,"156":156,"166":166,"171":171,"19":19,"66":66}],100:[function(_dereq_,module,exports){
15808/**
15809 * Copyright 2013-2015, Facebook, Inc.
15810 * All rights reserved.
15811 *
15812 * This source code is licensed under the BSD-style license found in the
15813 * LICENSE file in the root directory of this source tree. An additional grant
15814 * of patent rights can be found in the PATENTS file in the same directory.
15815 *
15816 * @providesModule ServerReactRootIndex
15817 * @typechecks
15818 */
15819
15820'use strict';
15821
15822/**
15823 * Size of the reactRoot ID space. We generate random numbers for React root
15824 * IDs and if there's a collision the events and DOM update system will
15825 * get confused. In the future we need a way to generate GUIDs but for
15826 * now this will work on a smaller scale.
15827 */
15828var GLOBAL_MOUNT_POINT_MAX = Math.pow(2, 53);
15829
15830var ServerReactRootIndex = {
15831 createReactRootIndex: function () {
15832 return Math.ceil(Math.random() * GLOBAL_MOUNT_POINT_MAX);
15833 }
15834};
15835
15836module.exports = ServerReactRootIndex;
15837},{}],101:[function(_dereq_,module,exports){
15838/**
15839 * Copyright 2013-2015, Facebook, Inc.
15840 * All rights reserved.
15841 *
15842 * This source code is licensed under the BSD-style license found in the
15843 * LICENSE file in the root directory of this source tree. An additional grant
15844 * of patent rights can be found in the PATENTS file in the same directory.
15845 *
15846 * @providesModule SimpleEventPlugin
15847 */
15848
15849'use strict';
15850
15851var EventConstants = _dereq_(15);
15852var EventListener = _dereq_(146);
15853var EventPropagators = _dereq_(19);
15854var ReactMount = _dereq_(72);
15855var SyntheticClipboardEvent = _dereq_(102);
15856var SyntheticEvent = _dereq_(105);
15857var SyntheticFocusEvent = _dereq_(106);
15858var SyntheticKeyboardEvent = _dereq_(108);
15859var SyntheticMouseEvent = _dereq_(109);
15860var SyntheticDragEvent = _dereq_(104);
15861var SyntheticTouchEvent = _dereq_(110);
15862var SyntheticUIEvent = _dereq_(111);
15863var SyntheticWheelEvent = _dereq_(112);
15864
15865var emptyFunction = _dereq_(153);
15866var getEventCharCode = _dereq_(125);
15867var invariant = _dereq_(161);
15868var keyOf = _dereq_(166);
15869
15870var topLevelTypes = EventConstants.topLevelTypes;
15871
15872var eventTypes = {
15873 abort: {
15874 phasedRegistrationNames: {
15875 bubbled: keyOf({ onAbort: true }),
15876 captured: keyOf({ onAbortCapture: true })
15877 }
15878 },
15879 blur: {
15880 phasedRegistrationNames: {
15881 bubbled: keyOf({ onBlur: true }),
15882 captured: keyOf({ onBlurCapture: true })
15883 }
15884 },
15885 canPlay: {
15886 phasedRegistrationNames: {
15887 bubbled: keyOf({ onCanPlay: true }),
15888 captured: keyOf({ onCanPlayCapture: true })
15889 }
15890 },
15891 canPlayThrough: {
15892 phasedRegistrationNames: {
15893 bubbled: keyOf({ onCanPlayThrough: true }),
15894 captured: keyOf({ onCanPlayThroughCapture: true })
15895 }
15896 },
15897 click: {
15898 phasedRegistrationNames: {
15899 bubbled: keyOf({ onClick: true }),
15900 captured: keyOf({ onClickCapture: true })
15901 }
15902 },
15903 contextMenu: {
15904 phasedRegistrationNames: {
15905 bubbled: keyOf({ onContextMenu: true }),
15906 captured: keyOf({ onContextMenuCapture: true })
15907 }
15908 },
15909 copy: {
15910 phasedRegistrationNames: {
15911 bubbled: keyOf({ onCopy: true }),
15912 captured: keyOf({ onCopyCapture: true })
15913 }
15914 },
15915 cut: {
15916 phasedRegistrationNames: {
15917 bubbled: keyOf({ onCut: true }),
15918 captured: keyOf({ onCutCapture: true })
15919 }
15920 },
15921 doubleClick: {
15922 phasedRegistrationNames: {
15923 bubbled: keyOf({ onDoubleClick: true }),
15924 captured: keyOf({ onDoubleClickCapture: true })
15925 }
15926 },
15927 drag: {
15928 phasedRegistrationNames: {
15929 bubbled: keyOf({ onDrag: true }),
15930 captured: keyOf({ onDragCapture: true })
15931 }
15932 },
15933 dragEnd: {
15934 phasedRegistrationNames: {
15935 bubbled: keyOf({ onDragEnd: true }),
15936 captured: keyOf({ onDragEndCapture: true })
15937 }
15938 },
15939 dragEnter: {
15940 phasedRegistrationNames: {
15941 bubbled: keyOf({ onDragEnter: true }),
15942 captured: keyOf({ onDragEnterCapture: true })
15943 }
15944 },
15945 dragExit: {
15946 phasedRegistrationNames: {
15947 bubbled: keyOf({ onDragExit: true }),
15948 captured: keyOf({ onDragExitCapture: true })
15949 }
15950 },
15951 dragLeave: {
15952 phasedRegistrationNames: {
15953 bubbled: keyOf({ onDragLeave: true }),
15954 captured: keyOf({ onDragLeaveCapture: true })
15955 }
15956 },
15957 dragOver: {
15958 phasedRegistrationNames: {
15959 bubbled: keyOf({ onDragOver: true }),
15960 captured: keyOf({ onDragOverCapture: true })
15961 }
15962 },
15963 dragStart: {
15964 phasedRegistrationNames: {
15965 bubbled: keyOf({ onDragStart: true }),
15966 captured: keyOf({ onDragStartCapture: true })
15967 }
15968 },
15969 drop: {
15970 phasedRegistrationNames: {
15971 bubbled: keyOf({ onDrop: true }),
15972 captured: keyOf({ onDropCapture: true })
15973 }
15974 },
15975 durationChange: {
15976 phasedRegistrationNames: {
15977 bubbled: keyOf({ onDurationChange: true }),
15978 captured: keyOf({ onDurationChangeCapture: true })
15979 }
15980 },
15981 emptied: {
15982 phasedRegistrationNames: {
15983 bubbled: keyOf({ onEmptied: true }),
15984 captured: keyOf({ onEmptiedCapture: true })
15985 }
15986 },
15987 encrypted: {
15988 phasedRegistrationNames: {
15989 bubbled: keyOf({ onEncrypted: true }),
15990 captured: keyOf({ onEncryptedCapture: true })
15991 }
15992 },
15993 ended: {
15994 phasedRegistrationNames: {
15995 bubbled: keyOf({ onEnded: true }),
15996 captured: keyOf({ onEndedCapture: true })
15997 }
15998 },
15999 error: {
16000 phasedRegistrationNames: {
16001 bubbled: keyOf({ onError: true }),
16002 captured: keyOf({ onErrorCapture: true })
16003 }
16004 },
16005 focus: {
16006 phasedRegistrationNames: {
16007 bubbled: keyOf({ onFocus: true }),
16008 captured: keyOf({ onFocusCapture: true })
16009 }
16010 },
16011 input: {
16012 phasedRegistrationNames: {
16013 bubbled: keyOf({ onInput: true }),
16014 captured: keyOf({ onInputCapture: true })
16015 }
16016 },
16017 keyDown: {
16018 phasedRegistrationNames: {
16019 bubbled: keyOf({ onKeyDown: true }),
16020 captured: keyOf({ onKeyDownCapture: true })
16021 }
16022 },
16023 keyPress: {
16024 phasedRegistrationNames: {
16025 bubbled: keyOf({ onKeyPress: true }),
16026 captured: keyOf({ onKeyPressCapture: true })
16027 }
16028 },
16029 keyUp: {
16030 phasedRegistrationNames: {
16031 bubbled: keyOf({ onKeyUp: true }),
16032 captured: keyOf({ onKeyUpCapture: true })
16033 }
16034 },
16035 load: {
16036 phasedRegistrationNames: {
16037 bubbled: keyOf({ onLoad: true }),
16038 captured: keyOf({ onLoadCapture: true })
16039 }
16040 },
16041 loadedData: {
16042 phasedRegistrationNames: {
16043 bubbled: keyOf({ onLoadedData: true }),
16044 captured: keyOf({ onLoadedDataCapture: true })
16045 }
16046 },
16047 loadedMetadata: {
16048 phasedRegistrationNames: {
16049 bubbled: keyOf({ onLoadedMetadata: true }),
16050 captured: keyOf({ onLoadedMetadataCapture: true })
16051 }
16052 },
16053 loadStart: {
16054 phasedRegistrationNames: {
16055 bubbled: keyOf({ onLoadStart: true }),
16056 captured: keyOf({ onLoadStartCapture: true })
16057 }
16058 },
16059 // Note: We do not allow listening to mouseOver events. Instead, use the
16060 // onMouseEnter/onMouseLeave created by `EnterLeaveEventPlugin`.
16061 mouseDown: {
16062 phasedRegistrationNames: {
16063 bubbled: keyOf({ onMouseDown: true }),
16064 captured: keyOf({ onMouseDownCapture: true })
16065 }
16066 },
16067 mouseMove: {
16068 phasedRegistrationNames: {
16069 bubbled: keyOf({ onMouseMove: true }),
16070 captured: keyOf({ onMouseMoveCapture: true })
16071 }
16072 },
16073 mouseOut: {
16074 phasedRegistrationNames: {
16075 bubbled: keyOf({ onMouseOut: true }),
16076 captured: keyOf({ onMouseOutCapture: true })
16077 }
16078 },
16079 mouseOver: {
16080 phasedRegistrationNames: {
16081 bubbled: keyOf({ onMouseOver: true }),
16082 captured: keyOf({ onMouseOverCapture: true })
16083 }
16084 },
16085 mouseUp: {
16086 phasedRegistrationNames: {
16087 bubbled: keyOf({ onMouseUp: true }),
16088 captured: keyOf({ onMouseUpCapture: true })
16089 }
16090 },
16091 paste: {
16092 phasedRegistrationNames: {
16093 bubbled: keyOf({ onPaste: true }),
16094 captured: keyOf({ onPasteCapture: true })
16095 }
16096 },
16097 pause: {
16098 phasedRegistrationNames: {
16099 bubbled: keyOf({ onPause: true }),
16100 captured: keyOf({ onPauseCapture: true })
16101 }
16102 },
16103 play: {
16104 phasedRegistrationNames: {
16105 bubbled: keyOf({ onPlay: true }),
16106 captured: keyOf({ onPlayCapture: true })
16107 }
16108 },
16109 playing: {
16110 phasedRegistrationNames: {
16111 bubbled: keyOf({ onPlaying: true }),
16112 captured: keyOf({ onPlayingCapture: true })
16113 }
16114 },
16115 progress: {
16116 phasedRegistrationNames: {
16117 bubbled: keyOf({ onProgress: true }),
16118 captured: keyOf({ onProgressCapture: true })
16119 }
16120 },
16121 rateChange: {
16122 phasedRegistrationNames: {
16123 bubbled: keyOf({ onRateChange: true }),
16124 captured: keyOf({ onRateChangeCapture: true })
16125 }
16126 },
16127 reset: {
16128 phasedRegistrationNames: {
16129 bubbled: keyOf({ onReset: true }),
16130 captured: keyOf({ onResetCapture: true })
16131 }
16132 },
16133 scroll: {
16134 phasedRegistrationNames: {
16135 bubbled: keyOf({ onScroll: true }),
16136 captured: keyOf({ onScrollCapture: true })
16137 }
16138 },
16139 seeked: {
16140 phasedRegistrationNames: {
16141 bubbled: keyOf({ onSeeked: true }),
16142 captured: keyOf({ onSeekedCapture: true })
16143 }
16144 },
16145 seeking: {
16146 phasedRegistrationNames: {
16147 bubbled: keyOf({ onSeeking: true }),
16148 captured: keyOf({ onSeekingCapture: true })
16149 }
16150 },
16151 stalled: {
16152 phasedRegistrationNames: {
16153 bubbled: keyOf({ onStalled: true }),
16154 captured: keyOf({ onStalledCapture: true })
16155 }
16156 },
16157 submit: {
16158 phasedRegistrationNames: {
16159 bubbled: keyOf({ onSubmit: true }),
16160 captured: keyOf({ onSubmitCapture: true })
16161 }
16162 },
16163 suspend: {
16164 phasedRegistrationNames: {
16165 bubbled: keyOf({ onSuspend: true }),
16166 captured: keyOf({ onSuspendCapture: true })
16167 }
16168 },
16169 timeUpdate: {
16170 phasedRegistrationNames: {
16171 bubbled: keyOf({ onTimeUpdate: true }),
16172 captured: keyOf({ onTimeUpdateCapture: true })
16173 }
16174 },
16175 touchCancel: {
16176 phasedRegistrationNames: {
16177 bubbled: keyOf({ onTouchCancel: true }),
16178 captured: keyOf({ onTouchCancelCapture: true })
16179 }
16180 },
16181 touchEnd: {
16182 phasedRegistrationNames: {
16183 bubbled: keyOf({ onTouchEnd: true }),
16184 captured: keyOf({ onTouchEndCapture: true })
16185 }
16186 },
16187 touchMove: {
16188 phasedRegistrationNames: {
16189 bubbled: keyOf({ onTouchMove: true }),
16190 captured: keyOf({ onTouchMoveCapture: true })
16191 }
16192 },
16193 touchStart: {
16194 phasedRegistrationNames: {
16195 bubbled: keyOf({ onTouchStart: true }),
16196 captured: keyOf({ onTouchStartCapture: true })
16197 }
16198 },
16199 volumeChange: {
16200 phasedRegistrationNames: {
16201 bubbled: keyOf({ onVolumeChange: true }),
16202 captured: keyOf({ onVolumeChangeCapture: true })
16203 }
16204 },
16205 waiting: {
16206 phasedRegistrationNames: {
16207 bubbled: keyOf({ onWaiting: true }),
16208 captured: keyOf({ onWaitingCapture: true })
16209 }
16210 },
16211 wheel: {
16212 phasedRegistrationNames: {
16213 bubbled: keyOf({ onWheel: true }),
16214 captured: keyOf({ onWheelCapture: true })
16215 }
16216 }
16217};
16218
16219var topLevelEventsToDispatchConfig = {
16220 topAbort: eventTypes.abort,
16221 topBlur: eventTypes.blur,
16222 topCanPlay: eventTypes.canPlay,
16223 topCanPlayThrough: eventTypes.canPlayThrough,
16224 topClick: eventTypes.click,
16225 topContextMenu: eventTypes.contextMenu,
16226 topCopy: eventTypes.copy,
16227 topCut: eventTypes.cut,
16228 topDoubleClick: eventTypes.doubleClick,
16229 topDrag: eventTypes.drag,
16230 topDragEnd: eventTypes.dragEnd,
16231 topDragEnter: eventTypes.dragEnter,
16232 topDragExit: eventTypes.dragExit,
16233 topDragLeave: eventTypes.dragLeave,
16234 topDragOver: eventTypes.dragOver,
16235 topDragStart: eventTypes.dragStart,
16236 topDrop: eventTypes.drop,
16237 topDurationChange: eventTypes.durationChange,
16238 topEmptied: eventTypes.emptied,
16239 topEncrypted: eventTypes.encrypted,
16240 topEnded: eventTypes.ended,
16241 topError: eventTypes.error,
16242 topFocus: eventTypes.focus,
16243 topInput: eventTypes.input,
16244 topKeyDown: eventTypes.keyDown,
16245 topKeyPress: eventTypes.keyPress,
16246 topKeyUp: eventTypes.keyUp,
16247 topLoad: eventTypes.load,
16248 topLoadedData: eventTypes.loadedData,
16249 topLoadedMetadata: eventTypes.loadedMetadata,
16250 topLoadStart: eventTypes.loadStart,
16251 topMouseDown: eventTypes.mouseDown,
16252 topMouseMove: eventTypes.mouseMove,
16253 topMouseOut: eventTypes.mouseOut,
16254 topMouseOver: eventTypes.mouseOver,
16255 topMouseUp: eventTypes.mouseUp,
16256 topPaste: eventTypes.paste,
16257 topPause: eventTypes.pause,
16258 topPlay: eventTypes.play,
16259 topPlaying: eventTypes.playing,
16260 topProgress: eventTypes.progress,
16261 topRateChange: eventTypes.rateChange,
16262 topReset: eventTypes.reset,
16263 topScroll: eventTypes.scroll,
16264 topSeeked: eventTypes.seeked,
16265 topSeeking: eventTypes.seeking,
16266 topStalled: eventTypes.stalled,
16267 topSubmit: eventTypes.submit,
16268 topSuspend: eventTypes.suspend,
16269 topTimeUpdate: eventTypes.timeUpdate,
16270 topTouchCancel: eventTypes.touchCancel,
16271 topTouchEnd: eventTypes.touchEnd,
16272 topTouchMove: eventTypes.touchMove,
16273 topTouchStart: eventTypes.touchStart,
16274 topVolumeChange: eventTypes.volumeChange,
16275 topWaiting: eventTypes.waiting,
16276 topWheel: eventTypes.wheel
16277};
16278
16279for (var type in topLevelEventsToDispatchConfig) {
16280 topLevelEventsToDispatchConfig[type].dependencies = [type];
16281}
16282
16283var ON_CLICK_KEY = keyOf({ onClick: null });
16284var onClickListeners = {};
16285
16286var SimpleEventPlugin = {
16287
16288 eventTypes: eventTypes,
16289
16290 /**
16291 * @param {string} topLevelType Record from `EventConstants`.
16292 * @param {DOMEventTarget} topLevelTarget The listening component root node.
16293 * @param {string} topLevelTargetID ID of `topLevelTarget`.
16294 * @param {object} nativeEvent Native browser event.
16295 * @return {*} An accumulation of synthetic events.
16296 * @see {EventPluginHub.extractEvents}
16297 */
16298 extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
16299 var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
16300 if (!dispatchConfig) {
16301 return null;
16302 }
16303 var EventConstructor;
16304 switch (topLevelType) {
16305 case topLevelTypes.topAbort:
16306 case topLevelTypes.topCanPlay:
16307 case topLevelTypes.topCanPlayThrough:
16308 case topLevelTypes.topDurationChange:
16309 case topLevelTypes.topEmptied:
16310 case topLevelTypes.topEncrypted:
16311 case topLevelTypes.topEnded:
16312 case topLevelTypes.topError:
16313 case topLevelTypes.topInput:
16314 case topLevelTypes.topLoad:
16315 case topLevelTypes.topLoadedData:
16316 case topLevelTypes.topLoadedMetadata:
16317 case topLevelTypes.topLoadStart:
16318 case topLevelTypes.topPause:
16319 case topLevelTypes.topPlay:
16320 case topLevelTypes.topPlaying:
16321 case topLevelTypes.topProgress:
16322 case topLevelTypes.topRateChange:
16323 case topLevelTypes.topReset:
16324 case topLevelTypes.topSeeked:
16325 case topLevelTypes.topSeeking:
16326 case topLevelTypes.topStalled:
16327 case topLevelTypes.topSubmit:
16328 case topLevelTypes.topSuspend:
16329 case topLevelTypes.topTimeUpdate:
16330 case topLevelTypes.topVolumeChange:
16331 case topLevelTypes.topWaiting:
16332 // HTML Events
16333 // @see http://www.w3.org/TR/html5/index.html#events-0
16334 EventConstructor = SyntheticEvent;
16335 break;
16336 case topLevelTypes.topKeyPress:
16337 // FireFox creates a keypress event for function keys too. This removes
16338 // the unwanted keypress events. Enter is however both printable and
16339 // non-printable. One would expect Tab to be as well (but it isn't).
16340 if (getEventCharCode(nativeEvent) === 0) {
16341 return null;
16342 }
16343 /* falls through */
16344 case topLevelTypes.topKeyDown:
16345 case topLevelTypes.topKeyUp:
16346 EventConstructor = SyntheticKeyboardEvent;
16347 break;
16348 case topLevelTypes.topBlur:
16349 case topLevelTypes.topFocus:
16350 EventConstructor = SyntheticFocusEvent;
16351 break;
16352 case topLevelTypes.topClick:
16353 // Firefox creates a click event on right mouse clicks. This removes the
16354 // unwanted click events.
16355 if (nativeEvent.button === 2) {
16356 return null;
16357 }
16358 /* falls through */
16359 case topLevelTypes.topContextMenu:
16360 case topLevelTypes.topDoubleClick:
16361 case topLevelTypes.topMouseDown:
16362 case topLevelTypes.topMouseMove:
16363 case topLevelTypes.topMouseOut:
16364 case topLevelTypes.topMouseOver:
16365 case topLevelTypes.topMouseUp:
16366 EventConstructor = SyntheticMouseEvent;
16367 break;
16368 case topLevelTypes.topDrag:
16369 case topLevelTypes.topDragEnd:
16370 case topLevelTypes.topDragEnter:
16371 case topLevelTypes.topDragExit:
16372 case topLevelTypes.topDragLeave:
16373 case topLevelTypes.topDragOver:
16374 case topLevelTypes.topDragStart:
16375 case topLevelTypes.topDrop:
16376 EventConstructor = SyntheticDragEvent;
16377 break;
16378 case topLevelTypes.topTouchCancel:
16379 case topLevelTypes.topTouchEnd:
16380 case topLevelTypes.topTouchMove:
16381 case topLevelTypes.topTouchStart:
16382 EventConstructor = SyntheticTouchEvent;
16383 break;
16384 case topLevelTypes.topScroll:
16385 EventConstructor = SyntheticUIEvent;
16386 break;
16387 case topLevelTypes.topWheel:
16388 EventConstructor = SyntheticWheelEvent;
16389 break;
16390 case topLevelTypes.topCopy:
16391 case topLevelTypes.topCut:
16392 case topLevelTypes.topPaste:
16393 EventConstructor = SyntheticClipboardEvent;
16394 break;
16395 }
16396 !EventConstructor ? "development" !== 'production' ? invariant(false, 'SimpleEventPlugin: Unhandled event type, `%s`.', topLevelType) : invariant(false) : undefined;
16397 var event = EventConstructor.getPooled(dispatchConfig, topLevelTargetID, nativeEvent, nativeEventTarget);
16398 EventPropagators.accumulateTwoPhaseDispatches(event);
16399 return event;
16400 },
16401
16402 didPutListener: function (id, registrationName, listener) {
16403 // Mobile Safari does not fire properly bubble click events on
16404 // non-interactive elements, which means delegated click listeners do not
16405 // fire. The workaround for this bug involves attaching an empty click
16406 // listener on the target node.
16407 if (registrationName === ON_CLICK_KEY) {
16408 var node = ReactMount.getNode(id);
16409 if (!onClickListeners[id]) {
16410 onClickListeners[id] = EventListener.listen(node, 'click', emptyFunction);
16411 }
16412 }
16413 },
16414
16415 willDeleteListener: function (id, registrationName) {
16416 if (registrationName === ON_CLICK_KEY) {
16417 onClickListeners[id].remove();
16418 delete onClickListeners[id];
16419 }
16420 }
16421
16422};
16423
16424module.exports = SimpleEventPlugin;
16425},{"102":102,"104":104,"105":105,"106":106,"108":108,"109":109,"110":110,"111":111,"112":112,"125":125,"146":146,"15":15,"153":153,"161":161,"166":166,"19":19,"72":72}],102:[function(_dereq_,module,exports){
16426/**
16427 * Copyright 2013-2015, Facebook, Inc.
16428 * All rights reserved.
16429 *
16430 * This source code is licensed under the BSD-style license found in the
16431 * LICENSE file in the root directory of this source tree. An additional grant
16432 * of patent rights can be found in the PATENTS file in the same directory.
16433 *
16434 * @providesModule SyntheticClipboardEvent
16435 * @typechecks static-only
16436 */
16437
16438'use strict';
16439
16440var SyntheticEvent = _dereq_(105);
16441
16442/**
16443 * @interface Event
16444 * @see http://www.w3.org/TR/clipboard-apis/
16445 */
16446var ClipboardEventInterface = {
16447 clipboardData: function (event) {
16448 return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
16449 }
16450};
16451
16452/**
16453 * @param {object} dispatchConfig Configuration used to dispatch this event.
16454 * @param {string} dispatchMarker Marker identifying the event target.
16455 * @param {object} nativeEvent Native browser event.
16456 * @extends {SyntheticUIEvent}
16457 */
16458function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
16459 SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
16460}
16461
16462SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface);
16463
16464module.exports = SyntheticClipboardEvent;
16465},{"105":105}],103:[function(_dereq_,module,exports){
16466/**
16467 * Copyright 2013-2015, Facebook, Inc.
16468 * All rights reserved.
16469 *
16470 * This source code is licensed under the BSD-style license found in the
16471 * LICENSE file in the root directory of this source tree. An additional grant
16472 * of patent rights can be found in the PATENTS file in the same directory.
16473 *
16474 * @providesModule SyntheticCompositionEvent
16475 * @typechecks static-only
16476 */
16477
16478'use strict';
16479
16480var SyntheticEvent = _dereq_(105);
16481
16482/**
16483 * @interface Event
16484 * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents
16485 */
16486var CompositionEventInterface = {
16487 data: null
16488};
16489
16490/**
16491 * @param {object} dispatchConfig Configuration used to dispatch this event.
16492 * @param {string} dispatchMarker Marker identifying the event target.
16493 * @param {object} nativeEvent Native browser event.
16494 * @extends {SyntheticUIEvent}
16495 */
16496function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
16497 SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
16498}
16499
16500SyntheticEvent.augmentClass(SyntheticCompositionEvent, CompositionEventInterface);
16501
16502module.exports = SyntheticCompositionEvent;
16503},{"105":105}],104:[function(_dereq_,module,exports){
16504/**
16505 * Copyright 2013-2015, Facebook, Inc.
16506 * All rights reserved.
16507 *
16508 * This source code is licensed under the BSD-style license found in the
16509 * LICENSE file in the root directory of this source tree. An additional grant
16510 * of patent rights can be found in the PATENTS file in the same directory.
16511 *
16512 * @providesModule SyntheticDragEvent
16513 * @typechecks static-only
16514 */
16515
16516'use strict';
16517
16518var SyntheticMouseEvent = _dereq_(109);
16519
16520/**
16521 * @interface DragEvent
16522 * @see http://www.w3.org/TR/DOM-Level-3-Events/
16523 */
16524var DragEventInterface = {
16525 dataTransfer: null
16526};
16527
16528/**
16529 * @param {object} dispatchConfig Configuration used to dispatch this event.
16530 * @param {string} dispatchMarker Marker identifying the event target.
16531 * @param {object} nativeEvent Native browser event.
16532 * @extends {SyntheticUIEvent}
16533 */
16534function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
16535 SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
16536}
16537
16538SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface);
16539
16540module.exports = SyntheticDragEvent;
16541},{"109":109}],105:[function(_dereq_,module,exports){
16542/**
16543 * Copyright 2013-2015, Facebook, Inc.
16544 * All rights reserved.
16545 *
16546 * This source code is licensed under the BSD-style license found in the
16547 * LICENSE file in the root directory of this source tree. An additional grant
16548 * of patent rights can be found in the PATENTS file in the same directory.
16549 *
16550 * @providesModule SyntheticEvent
16551 * @typechecks static-only
16552 */
16553
16554'use strict';
16555
16556var PooledClass = _dereq_(25);
16557
16558var assign = _dereq_(24);
16559var emptyFunction = _dereq_(153);
16560var warning = _dereq_(173);
16561
16562/**
16563 * @interface Event
16564 * @see http://www.w3.org/TR/DOM-Level-3-Events/
16565 */
16566var EventInterface = {
16567 type: null,
16568 // currentTarget is set when dispatching; no use in copying it here
16569 currentTarget: emptyFunction.thatReturnsNull,
16570 eventPhase: null,
16571 bubbles: null,
16572 cancelable: null,
16573 timeStamp: function (event) {
16574 return event.timeStamp || Date.now();
16575 },
16576 defaultPrevented: null,
16577 isTrusted: null
16578};
16579
16580/**
16581 * Synthetic events are dispatched by event plugins, typically in response to a
16582 * top-level event delegation handler.
16583 *
16584 * These systems should generally use pooling to reduce the frequency of garbage
16585 * collection. The system should check `isPersistent` to determine whether the
16586 * event should be released into the pool after being dispatched. Users that
16587 * need a persisted event should invoke `persist`.
16588 *
16589 * Synthetic events (and subclasses) implement the DOM Level 3 Events API by
16590 * normalizing browser quirks. Subclasses do not necessarily have to implement a
16591 * DOM interface; custom application-specific events can also subclass this.
16592 *
16593 * @param {object} dispatchConfig Configuration used to dispatch this event.
16594 * @param {string} dispatchMarker Marker identifying the event target.
16595 * @param {object} nativeEvent Native browser event.
16596 */
16597function SyntheticEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
16598 this.dispatchConfig = dispatchConfig;
16599 this.dispatchMarker = dispatchMarker;
16600 this.nativeEvent = nativeEvent;
16601 this.target = nativeEventTarget;
16602 this.currentTarget = nativeEventTarget;
16603
16604 var Interface = this.constructor.Interface;
16605 for (var propName in Interface) {
16606 if (!Interface.hasOwnProperty(propName)) {
16607 continue;
16608 }
16609 var normalize = Interface[propName];
16610 if (normalize) {
16611 this[propName] = normalize(nativeEvent);
16612 } else {
16613 this[propName] = nativeEvent[propName];
16614 }
16615 }
16616
16617 var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
16618 if (defaultPrevented) {
16619 this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
16620 } else {
16621 this.isDefaultPrevented = emptyFunction.thatReturnsFalse;
16622 }
16623 this.isPropagationStopped = emptyFunction.thatReturnsFalse;
16624}
16625
16626assign(SyntheticEvent.prototype, {
16627
16628 preventDefault: function () {
16629 this.defaultPrevented = true;
16630 var event = this.nativeEvent;
16631 if ("development" !== 'production') {
16632 "development" !== 'production' ? warning(event, 'This synthetic event is reused for performance reasons. If you\'re ' + 'seeing this, you\'re calling `preventDefault` on a ' + 'released/nullified synthetic event. This is a no-op. See ' + 'https://fb.me/react-event-pooling for more information.') : undefined;
16633 }
16634 if (!event) {
16635 return;
16636 }
16637
16638 if (event.preventDefault) {
16639 event.preventDefault();
16640 } else {
16641 event.returnValue = false;
16642 }
16643 this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
16644 },
16645
16646 stopPropagation: function () {
16647 var event = this.nativeEvent;
16648 if ("development" !== 'production') {
16649 "development" !== 'production' ? warning(event, 'This synthetic event is reused for performance reasons. If you\'re ' + 'seeing this, you\'re calling `stopPropagation` on a ' + 'released/nullified synthetic event. This is a no-op. See ' + 'https://fb.me/react-event-pooling for more information.') : undefined;
16650 }
16651 if (!event) {
16652 return;
16653 }
16654
16655 if (event.stopPropagation) {
16656 event.stopPropagation();
16657 } else {
16658 event.cancelBubble = true;
16659 }
16660 this.isPropagationStopped = emptyFunction.thatReturnsTrue;
16661 },
16662
16663 /**
16664 * We release all dispatched `SyntheticEvent`s after each event loop, adding
16665 * them back into the pool. This allows a way to hold onto a reference that
16666 * won't be added back into the pool.
16667 */
16668 persist: function () {
16669 this.isPersistent = emptyFunction.thatReturnsTrue;
16670 },
16671
16672 /**
16673 * Checks if this event should be released back into the pool.
16674 *
16675 * @return {boolean} True if this should not be released, false otherwise.
16676 */
16677 isPersistent: emptyFunction.thatReturnsFalse,
16678
16679 /**
16680 * `PooledClass` looks for `destructor` on each instance it releases.
16681 */
16682 destructor: function () {
16683 var Interface = this.constructor.Interface;
16684 for (var propName in Interface) {
16685 this[propName] = null;
16686 }
16687 this.dispatchConfig = null;
16688 this.dispatchMarker = null;
16689 this.nativeEvent = null;
16690 }
16691
16692});
16693
16694SyntheticEvent.Interface = EventInterface;
16695
16696/**
16697 * Helper to reduce boilerplate when creating subclasses.
16698 *
16699 * @param {function} Class
16700 * @param {?object} Interface
16701 */
16702SyntheticEvent.augmentClass = function (Class, Interface) {
16703 var Super = this;
16704
16705 var prototype = Object.create(Super.prototype);
16706 assign(prototype, Class.prototype);
16707 Class.prototype = prototype;
16708 Class.prototype.constructor = Class;
16709
16710 Class.Interface = assign({}, Super.Interface, Interface);
16711 Class.augmentClass = Super.augmentClass;
16712
16713 PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler);
16714};
16715
16716PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler);
16717
16718module.exports = SyntheticEvent;
16719},{"153":153,"173":173,"24":24,"25":25}],106:[function(_dereq_,module,exports){
16720/**
16721 * Copyright 2013-2015, Facebook, Inc.
16722 * All rights reserved.
16723 *
16724 * This source code is licensed under the BSD-style license found in the
16725 * LICENSE file in the root directory of this source tree. An additional grant
16726 * of patent rights can be found in the PATENTS file in the same directory.
16727 *
16728 * @providesModule SyntheticFocusEvent
16729 * @typechecks static-only
16730 */
16731
16732'use strict';
16733
16734var SyntheticUIEvent = _dereq_(111);
16735
16736/**
16737 * @interface FocusEvent
16738 * @see http://www.w3.org/TR/DOM-Level-3-Events/
16739 */
16740var FocusEventInterface = {
16741 relatedTarget: null
16742};
16743
16744/**
16745 * @param {object} dispatchConfig Configuration used to dispatch this event.
16746 * @param {string} dispatchMarker Marker identifying the event target.
16747 * @param {object} nativeEvent Native browser event.
16748 * @extends {SyntheticUIEvent}
16749 */
16750function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
16751 SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
16752}
16753
16754SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface);
16755
16756module.exports = SyntheticFocusEvent;
16757},{"111":111}],107:[function(_dereq_,module,exports){
16758/**
16759 * Copyright 2013-2015, Facebook, Inc.
16760 * All rights reserved.
16761 *
16762 * This source code is licensed under the BSD-style license found in the
16763 * LICENSE file in the root directory of this source tree. An additional grant
16764 * of patent rights can be found in the PATENTS file in the same directory.
16765 *
16766 * @providesModule SyntheticInputEvent
16767 * @typechecks static-only
16768 */
16769
16770'use strict';
16771
16772var SyntheticEvent = _dereq_(105);
16773
16774/**
16775 * @interface Event
16776 * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105
16777 * /#events-inputevents
16778 */
16779var InputEventInterface = {
16780 data: null
16781};
16782
16783/**
16784 * @param {object} dispatchConfig Configuration used to dispatch this event.
16785 * @param {string} dispatchMarker Marker identifying the event target.
16786 * @param {object} nativeEvent Native browser event.
16787 * @extends {SyntheticUIEvent}
16788 */
16789function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
16790 SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
16791}
16792
16793SyntheticEvent.augmentClass(SyntheticInputEvent, InputEventInterface);
16794
16795module.exports = SyntheticInputEvent;
16796},{"105":105}],108:[function(_dereq_,module,exports){
16797/**
16798 * Copyright 2013-2015, Facebook, Inc.
16799 * All rights reserved.
16800 *
16801 * This source code is licensed under the BSD-style license found in the
16802 * LICENSE file in the root directory of this source tree. An additional grant
16803 * of patent rights can be found in the PATENTS file in the same directory.
16804 *
16805 * @providesModule SyntheticKeyboardEvent
16806 * @typechecks static-only
16807 */
16808
16809'use strict';
16810
16811var SyntheticUIEvent = _dereq_(111);
16812
16813var getEventCharCode = _dereq_(125);
16814var getEventKey = _dereq_(126);
16815var getEventModifierState = _dereq_(127);
16816
16817/**
16818 * @interface KeyboardEvent
16819 * @see http://www.w3.org/TR/DOM-Level-3-Events/
16820 */
16821var KeyboardEventInterface = {
16822 key: getEventKey,
16823 location: null,
16824 ctrlKey: null,
16825 shiftKey: null,
16826 altKey: null,
16827 metaKey: null,
16828 repeat: null,
16829 locale: null,
16830 getModifierState: getEventModifierState,
16831 // Legacy Interface
16832 charCode: function (event) {
16833 // `charCode` is the result of a KeyPress event and represents the value of
16834 // the actual printable character.
16835
16836 // KeyPress is deprecated, but its replacement is not yet final and not
16837 // implemented in any major browser. Only KeyPress has charCode.
16838 if (event.type === 'keypress') {
16839 return getEventCharCode(event);
16840 }
16841 return 0;
16842 },
16843 keyCode: function (event) {
16844 // `keyCode` is the result of a KeyDown/Up event and represents the value of
16845 // physical keyboard key.
16846
16847 // The actual meaning of the value depends on the users' keyboard layout
16848 // which cannot be detected. Assuming that it is a US keyboard layout
16849 // provides a surprisingly accurate mapping for US and European users.
16850 // Due to this, it is left to the user to implement at this time.
16851 if (event.type === 'keydown' || event.type === 'keyup') {
16852 return event.keyCode;
16853 }
16854 return 0;
16855 },
16856 which: function (event) {
16857 // `which` is an alias for either `keyCode` or `charCode` depending on the
16858 // type of the event.
16859 if (event.type === 'keypress') {
16860 return getEventCharCode(event);
16861 }
16862 if (event.type === 'keydown' || event.type === 'keyup') {
16863 return event.keyCode;
16864 }
16865 return 0;
16866 }
16867};
16868
16869/**
16870 * @param {object} dispatchConfig Configuration used to dispatch this event.
16871 * @param {string} dispatchMarker Marker identifying the event target.
16872 * @param {object} nativeEvent Native browser event.
16873 * @extends {SyntheticUIEvent}
16874 */
16875function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
16876 SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
16877}
16878
16879SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface);
16880
16881module.exports = SyntheticKeyboardEvent;
16882},{"111":111,"125":125,"126":126,"127":127}],109:[function(_dereq_,module,exports){
16883/**
16884 * Copyright 2013-2015, Facebook, Inc.
16885 * All rights reserved.
16886 *
16887 * This source code is licensed under the BSD-style license found in the
16888 * LICENSE file in the root directory of this source tree. An additional grant
16889 * of patent rights can be found in the PATENTS file in the same directory.
16890 *
16891 * @providesModule SyntheticMouseEvent
16892 * @typechecks static-only
16893 */
16894
16895'use strict';
16896
16897var SyntheticUIEvent = _dereq_(111);
16898var ViewportMetrics = _dereq_(114);
16899
16900var getEventModifierState = _dereq_(127);
16901
16902/**
16903 * @interface MouseEvent
16904 * @see http://www.w3.org/TR/DOM-Level-3-Events/
16905 */
16906var MouseEventInterface = {
16907 screenX: null,
16908 screenY: null,
16909 clientX: null,
16910 clientY: null,
16911 ctrlKey: null,
16912 shiftKey: null,
16913 altKey: null,
16914 metaKey: null,
16915 getModifierState: getEventModifierState,
16916 button: function (event) {
16917 // Webkit, Firefox, IE9+
16918 // which: 1 2 3
16919 // button: 0 1 2 (standard)
16920 var button = event.button;
16921 if ('which' in event) {
16922 return button;
16923 }
16924 // IE<9
16925 // which: undefined
16926 // button: 0 0 0
16927 // button: 1 4 2 (onmouseup)
16928 return button === 2 ? 2 : button === 4 ? 1 : 0;
16929 },
16930 buttons: null,
16931 relatedTarget: function (event) {
16932 return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);
16933 },
16934 // "Proprietary" Interface.
16935 pageX: function (event) {
16936 return 'pageX' in event ? event.pageX : event.clientX + ViewportMetrics.currentScrollLeft;
16937 },
16938 pageY: function (event) {
16939 return 'pageY' in event ? event.pageY : event.clientY + ViewportMetrics.currentScrollTop;
16940 }
16941};
16942
16943/**
16944 * @param {object} dispatchConfig Configuration used to dispatch this event.
16945 * @param {string} dispatchMarker Marker identifying the event target.
16946 * @param {object} nativeEvent Native browser event.
16947 * @extends {SyntheticUIEvent}
16948 */
16949function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
16950 SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
16951}
16952
16953SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface);
16954
16955module.exports = SyntheticMouseEvent;
16956},{"111":111,"114":114,"127":127}],110:[function(_dereq_,module,exports){
16957/**
16958 * Copyright 2013-2015, Facebook, Inc.
16959 * All rights reserved.
16960 *
16961 * This source code is licensed under the BSD-style license found in the
16962 * LICENSE file in the root directory of this source tree. An additional grant
16963 * of patent rights can be found in the PATENTS file in the same directory.
16964 *
16965 * @providesModule SyntheticTouchEvent
16966 * @typechecks static-only
16967 */
16968
16969'use strict';
16970
16971var SyntheticUIEvent = _dereq_(111);
16972
16973var getEventModifierState = _dereq_(127);
16974
16975/**
16976 * @interface TouchEvent
16977 * @see http://www.w3.org/TR/touch-events/
16978 */
16979var TouchEventInterface = {
16980 touches: null,
16981 targetTouches: null,
16982 changedTouches: null,
16983 altKey: null,
16984 metaKey: null,
16985 ctrlKey: null,
16986 shiftKey: null,
16987 getModifierState: getEventModifierState
16988};
16989
16990/**
16991 * @param {object} dispatchConfig Configuration used to dispatch this event.
16992 * @param {string} dispatchMarker Marker identifying the event target.
16993 * @param {object} nativeEvent Native browser event.
16994 * @extends {SyntheticUIEvent}
16995 */
16996function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
16997 SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
16998}
16999
17000SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface);
17001
17002module.exports = SyntheticTouchEvent;
17003},{"111":111,"127":127}],111:[function(_dereq_,module,exports){
17004/**
17005 * Copyright 2013-2015, Facebook, Inc.
17006 * All rights reserved.
17007 *
17008 * This source code is licensed under the BSD-style license found in the
17009 * LICENSE file in the root directory of this source tree. An additional grant
17010 * of patent rights can be found in the PATENTS file in the same directory.
17011 *
17012 * @providesModule SyntheticUIEvent
17013 * @typechecks static-only
17014 */
17015
17016'use strict';
17017
17018var SyntheticEvent = _dereq_(105);
17019
17020var getEventTarget = _dereq_(128);
17021
17022/**
17023 * @interface UIEvent
17024 * @see http://www.w3.org/TR/DOM-Level-3-Events/
17025 */
17026var UIEventInterface = {
17027 view: function (event) {
17028 if (event.view) {
17029 return event.view;
17030 }
17031
17032 var target = getEventTarget(event);
17033 if (target != null && target.window === target) {
17034 // target is a window object
17035 return target;
17036 }
17037
17038 var doc = target.ownerDocument;
17039 // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
17040 if (doc) {
17041 return doc.defaultView || doc.parentWindow;
17042 } else {
17043 return window;
17044 }
17045 },
17046 detail: function (event) {
17047 return event.detail || 0;
17048 }
17049};
17050
17051/**
17052 * @param {object} dispatchConfig Configuration used to dispatch this event.
17053 * @param {string} dispatchMarker Marker identifying the event target.
17054 * @param {object} nativeEvent Native browser event.
17055 * @extends {SyntheticEvent}
17056 */
17057function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
17058 SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
17059}
17060
17061SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface);
17062
17063module.exports = SyntheticUIEvent;
17064},{"105":105,"128":128}],112:[function(_dereq_,module,exports){
17065/**
17066 * Copyright 2013-2015, Facebook, Inc.
17067 * All rights reserved.
17068 *
17069 * This source code is licensed under the BSD-style license found in the
17070 * LICENSE file in the root directory of this source tree. An additional grant
17071 * of patent rights can be found in the PATENTS file in the same directory.
17072 *
17073 * @providesModule SyntheticWheelEvent
17074 * @typechecks static-only
17075 */
17076
17077'use strict';
17078
17079var SyntheticMouseEvent = _dereq_(109);
17080
17081/**
17082 * @interface WheelEvent
17083 * @see http://www.w3.org/TR/DOM-Level-3-Events/
17084 */
17085var WheelEventInterface = {
17086 deltaX: function (event) {
17087 return 'deltaX' in event ? event.deltaX :
17088 // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
17089 'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
17090 },
17091 deltaY: function (event) {
17092 return 'deltaY' in event ? event.deltaY :
17093 // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
17094 'wheelDeltaY' in event ? -event.wheelDeltaY :
17095 // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
17096 'wheelDelta' in event ? -event.wheelDelta : 0;
17097 },
17098 deltaZ: null,
17099
17100 // Browsers without "deltaMode" is reporting in raw wheel delta where one
17101 // notch on the scroll is always +/- 120, roughly equivalent to pixels.
17102 // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
17103 // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
17104 deltaMode: null
17105};
17106
17107/**
17108 * @param {object} dispatchConfig Configuration used to dispatch this event.
17109 * @param {string} dispatchMarker Marker identifying the event target.
17110 * @param {object} nativeEvent Native browser event.
17111 * @extends {SyntheticMouseEvent}
17112 */
17113function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
17114 SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
17115}
17116
17117SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface);
17118
17119module.exports = SyntheticWheelEvent;
17120},{"109":109}],113:[function(_dereq_,module,exports){
17121/**
17122 * Copyright 2013-2015, Facebook, Inc.
17123 * All rights reserved.
17124 *
17125 * This source code is licensed under the BSD-style license found in the
17126 * LICENSE file in the root directory of this source tree. An additional grant
17127 * of patent rights can be found in the PATENTS file in the same directory.
17128 *
17129 * @providesModule Transaction
17130 */
17131
17132'use strict';
17133
17134var invariant = _dereq_(161);
17135
17136/**
17137 * `Transaction` creates a black box that is able to wrap any method such that
17138 * certain invariants are maintained before and after the method is invoked
17139 * (Even if an exception is thrown while invoking the wrapped method). Whoever
17140 * instantiates a transaction can provide enforcers of the invariants at
17141 * creation time. The `Transaction` class itself will supply one additional
17142 * automatic invariant for you - the invariant that any transaction instance
17143 * should not be run while it is already being run. You would typically create a
17144 * single instance of a `Transaction` for reuse multiple times, that potentially
17145 * is used to wrap several different methods. Wrappers are extremely simple -
17146 * they only require implementing two methods.
17147 *
17148 * <pre>
17149 * wrappers (injected at creation time)
17150 * + +
17151 * | |
17152 * +-----------------|--------|--------------+
17153 * | v | |
17154 * | +---------------+ | |
17155 * | +--| wrapper1 |---|----+ |
17156 * | | +---------------+ v | |
17157 * | | +-------------+ | |
17158 * | | +----| wrapper2 |--------+ |
17159 * | | | +-------------+ | | |
17160 * | | | | | |
17161 * | v v v v | wrapper
17162 * | +---+ +---+ +---------+ +---+ +---+ | invariants
17163 * perform(anyMethod) | | | | | | | | | | | | maintained
17164 * +----------------->|-|---|-|---|-->|anyMethod|---|---|-|---|-|-------->
17165 * | | | | | | | | | | | |
17166 * | | | | | | | | | | | |
17167 * | | | | | | | | | | | |
17168 * | +---+ +---+ +---------+ +---+ +---+ |
17169 * | initialize close |
17170 * +-----------------------------------------+
17171 * </pre>
17172 *
17173 * Use cases:
17174 * - Preserving the input selection ranges before/after reconciliation.
17175 * Restoring selection even in the event of an unexpected error.
17176 * - Deactivating events while rearranging the DOM, preventing blurs/focuses,
17177 * while guaranteeing that afterwards, the event system is reactivated.
17178 * - Flushing a queue of collected DOM mutations to the main UI thread after a
17179 * reconciliation takes place in a worker thread.
17180 * - Invoking any collected `componentDidUpdate` callbacks after rendering new
17181 * content.
17182 * - (Future use case): Wrapping particular flushes of the `ReactWorker` queue
17183 * to preserve the `scrollTop` (an automatic scroll aware DOM).
17184 * - (Future use case): Layout calculations before and after DOM updates.
17185 *
17186 * Transactional plugin API:
17187 * - A module that has an `initialize` method that returns any precomputation.
17188 * - and a `close` method that accepts the precomputation. `close` is invoked
17189 * when the wrapped process is completed, or has failed.
17190 *
17191 * @param {Array<TransactionalWrapper>} transactionWrapper Wrapper modules
17192 * that implement `initialize` and `close`.
17193 * @return {Transaction} Single transaction for reuse in thread.
17194 *
17195 * @class Transaction
17196 */
17197var Mixin = {
17198 /**
17199 * Sets up this instance so that it is prepared for collecting metrics. Does
17200 * so such that this setup method may be used on an instance that is already
17201 * initialized, in a way that does not consume additional memory upon reuse.
17202 * That can be useful if you decide to make your subclass of this mixin a
17203 * "PooledClass".
17204 */
17205 reinitializeTransaction: function () {
17206 this.transactionWrappers = this.getTransactionWrappers();
17207 if (this.wrapperInitData) {
17208 this.wrapperInitData.length = 0;
17209 } else {
17210 this.wrapperInitData = [];
17211 }
17212 this._isInTransaction = false;
17213 },
17214
17215 _isInTransaction: false,
17216
17217 /**
17218 * @abstract
17219 * @return {Array<TransactionWrapper>} Array of transaction wrappers.
17220 */
17221 getTransactionWrappers: null,
17222
17223 isInTransaction: function () {
17224 return !!this._isInTransaction;
17225 },
17226
17227 /**
17228 * Executes the function within a safety window. Use this for the top level
17229 * methods that result in large amounts of computation/mutations that would
17230 * need to be safety checked. The optional arguments helps prevent the need
17231 * to bind in many cases.
17232 *
17233 * @param {function} method Member of scope to call.
17234 * @param {Object} scope Scope to invoke from.
17235 * @param {Object?=} a Argument to pass to the method.
17236 * @param {Object?=} b Argument to pass to the method.
17237 * @param {Object?=} c Argument to pass to the method.
17238 * @param {Object?=} d Argument to pass to the method.
17239 * @param {Object?=} e Argument to pass to the method.
17240 * @param {Object?=} f Argument to pass to the method.
17241 *
17242 * @return {*} Return value from `method`.
17243 */
17244 perform: function (method, scope, a, b, c, d, e, f) {
17245 !!this.isInTransaction() ? "development" !== 'production' ? invariant(false, 'Transaction.perform(...): Cannot initialize a transaction when there ' + 'is already an outstanding transaction.') : invariant(false) : undefined;
17246 var errorThrown;
17247 var ret;
17248 try {
17249 this._isInTransaction = true;
17250 // Catching errors makes debugging more difficult, so we start with
17251 // errorThrown set to true before setting it to false after calling
17252 // close -- if it's still set to true in the finally block, it means
17253 // one of these calls threw.
17254 errorThrown = true;
17255 this.initializeAll(0);
17256 ret = method.call(scope, a, b, c, d, e, f);
17257 errorThrown = false;
17258 } finally {
17259 try {
17260 if (errorThrown) {
17261 // If `method` throws, prefer to show that stack trace over any thrown
17262 // by invoking `closeAll`.
17263 try {
17264 this.closeAll(0);
17265 } catch (err) {}
17266 } else {
17267 // Since `method` didn't throw, we don't want to silence the exception
17268 // here.
17269 this.closeAll(0);
17270 }
17271 } finally {
17272 this._isInTransaction = false;
17273 }
17274 }
17275 return ret;
17276 },
17277
17278 initializeAll: function (startIndex) {
17279 var transactionWrappers = this.transactionWrappers;
17280 for (var i = startIndex; i < transactionWrappers.length; i++) {
17281 var wrapper = transactionWrappers[i];
17282 try {
17283 // Catching errors makes debugging more difficult, so we start with the
17284 // OBSERVED_ERROR state before overwriting it with the real return value
17285 // of initialize -- if it's still set to OBSERVED_ERROR in the finally
17286 // block, it means wrapper.initialize threw.
17287 this.wrapperInitData[i] = Transaction.OBSERVED_ERROR;
17288 this.wrapperInitData[i] = wrapper.initialize ? wrapper.initialize.call(this) : null;
17289 } finally {
17290 if (this.wrapperInitData[i] === Transaction.OBSERVED_ERROR) {
17291 // The initializer for wrapper i threw an error; initialize the
17292 // remaining wrappers but silence any exceptions from them to ensure
17293 // that the first error is the one to bubble up.
17294 try {
17295 this.initializeAll(i + 1);
17296 } catch (err) {}
17297 }
17298 }
17299 }
17300 },
17301
17302 /**
17303 * Invokes each of `this.transactionWrappers.close[i]` functions, passing into
17304 * them the respective return values of `this.transactionWrappers.init[i]`
17305 * (`close`rs that correspond to initializers that failed will not be
17306 * invoked).
17307 */
17308 closeAll: function (startIndex) {
17309 !this.isInTransaction() ? "development" !== 'production' ? invariant(false, 'Transaction.closeAll(): Cannot close transaction when none are open.') : invariant(false) : undefined;
17310 var transactionWrappers = this.transactionWrappers;
17311 for (var i = startIndex; i < transactionWrappers.length; i++) {
17312 var wrapper = transactionWrappers[i];
17313 var initData = this.wrapperInitData[i];
17314 var errorThrown;
17315 try {
17316 // Catching errors makes debugging more difficult, so we start with
17317 // errorThrown set to true before setting it to false after calling
17318 // close -- if it's still set to true in the finally block, it means
17319 // wrapper.close threw.
17320 errorThrown = true;
17321 if (initData !== Transaction.OBSERVED_ERROR && wrapper.close) {
17322 wrapper.close.call(this, initData);
17323 }
17324 errorThrown = false;
17325 } finally {
17326 if (errorThrown) {
17327 // The closer for wrapper i threw an error; close the remaining
17328 // wrappers but silence any exceptions from them to ensure that the
17329 // first error is the one to bubble up.
17330 try {
17331 this.closeAll(i + 1);
17332 } catch (e) {}
17333 }
17334 }
17335 }
17336 this.wrapperInitData.length = 0;
17337 }
17338};
17339
17340var Transaction = {
17341
17342 Mixin: Mixin,
17343
17344 /**
17345 * Token to look for to determine if an error occurred.
17346 */
17347 OBSERVED_ERROR: {}
17348
17349};
17350
17351module.exports = Transaction;
17352},{"161":161}],114:[function(_dereq_,module,exports){
17353/**
17354 * Copyright 2013-2015, Facebook, Inc.
17355 * All rights reserved.
17356 *
17357 * This source code is licensed under the BSD-style license found in the
17358 * LICENSE file in the root directory of this source tree. An additional grant
17359 * of patent rights can be found in the PATENTS file in the same directory.
17360 *
17361 * @providesModule ViewportMetrics
17362 */
17363
17364'use strict';
17365
17366var ViewportMetrics = {
17367
17368 currentScrollLeft: 0,
17369
17370 currentScrollTop: 0,
17371
17372 refreshScrollValues: function (scrollPosition) {
17373 ViewportMetrics.currentScrollLeft = scrollPosition.x;
17374 ViewportMetrics.currentScrollTop = scrollPosition.y;
17375 }
17376
17377};
17378
17379module.exports = ViewportMetrics;
17380},{}],115:[function(_dereq_,module,exports){
17381/**
17382 * Copyright 2014-2015, Facebook, Inc.
17383 * All rights reserved.
17384 *
17385 * This source code is licensed under the BSD-style license found in the
17386 * LICENSE file in the root directory of this source tree. An additional grant
17387 * of patent rights can be found in the PATENTS file in the same directory.
17388 *
17389 * @providesModule accumulateInto
17390 */
17391
17392'use strict';
17393
17394var invariant = _dereq_(161);
17395
17396/**
17397 *
17398 * Accumulates items that must not be null or undefined into the first one. This
17399 * is used to conserve memory by avoiding array allocations, and thus sacrifices
17400 * API cleanness. Since `current` can be null before being passed in and not
17401 * null after this function, make sure to assign it back to `current`:
17402 *
17403 * `a = accumulateInto(a, b);`
17404 *
17405 * This API should be sparingly used. Try `accumulate` for something cleaner.
17406 *
17407 * @return {*|array<*>} An accumulation of items.
17408 */
17409
17410function accumulateInto(current, next) {
17411 !(next != null) ? "development" !== 'production' ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : invariant(false) : undefined;
17412 if (current == null) {
17413 return next;
17414 }
17415
17416 // Both are not empty. Warning: Never call x.concat(y) when you are not
17417 // certain that x is an Array (x could be a string with concat method).
17418 var currentIsArray = Array.isArray(current);
17419 var nextIsArray = Array.isArray(next);
17420
17421 if (currentIsArray && nextIsArray) {
17422 current.push.apply(current, next);
17423 return current;
17424 }
17425
17426 if (currentIsArray) {
17427 current.push(next);
17428 return current;
17429 }
17430
17431 if (nextIsArray) {
17432 // A bit too dangerous to mutate `next`.
17433 return [current].concat(next);
17434 }
17435
17436 return [current, next];
17437}
17438
17439module.exports = accumulateInto;
17440},{"161":161}],116:[function(_dereq_,module,exports){
17441/**
17442 * Copyright 2013-2015, Facebook, Inc.
17443 * All rights reserved.
17444 *
17445 * This source code is licensed under the BSD-style license found in the
17446 * LICENSE file in the root directory of this source tree. An additional grant
17447 * of patent rights can be found in the PATENTS file in the same directory.
17448 *
17449 * @providesModule adler32
17450 */
17451
17452'use strict';
17453
17454var MOD = 65521;
17455
17456// adler32 is not cryptographically strong, and is only used to sanity check that
17457// markup generated on the server matches the markup generated on the client.
17458// This implementation (a modified version of the SheetJS version) has been optimized
17459// for our use case, at the expense of conforming to the adler32 specification
17460// for non-ascii inputs.
17461function adler32(data) {
17462 var a = 1;
17463 var b = 0;
17464 var i = 0;
17465 var l = data.length;
17466 var m = l & ~0x3;
17467 while (i < m) {
17468 for (; i < Math.min(i + 4096, m); i += 4) {
17469 b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));
17470 }
17471 a %= MOD;
17472 b %= MOD;
17473 }
17474 for (; i < l; i++) {
17475 b += a += data.charCodeAt(i);
17476 }
17477 a %= MOD;
17478 b %= MOD;
17479 return a | b << 16;
17480}
17481
17482module.exports = adler32;
17483},{}],117:[function(_dereq_,module,exports){
17484/**
17485 * Copyright 2013-2015, Facebook, Inc.
17486 * All rights reserved.
17487 *
17488 * This source code is licensed under the BSD-style license found in the
17489 * LICENSE file in the root directory of this source tree. An additional grant
17490 * of patent rights can be found in the PATENTS file in the same directory.
17491 *
17492 * @providesModule canDefineProperty
17493 */
17494
17495'use strict';
17496
17497var canDefineProperty = false;
17498if ("development" !== 'production') {
17499 try {
17500 Object.defineProperty({}, 'x', { get: function () {} });
17501 canDefineProperty = true;
17502 } catch (x) {
17503 // IE will fail on defineProperty
17504 }
17505}
17506
17507module.exports = canDefineProperty;
17508},{}],118:[function(_dereq_,module,exports){
17509/**
17510 * Copyright 2013-2015, Facebook, Inc.
17511 * All rights reserved.
17512 *
17513 * This source code is licensed under the BSD-style license found in the
17514 * LICENSE file in the root directory of this source tree. An additional grant
17515 * of patent rights can be found in the PATENTS file in the same directory.
17516 *
17517 * @typechecks static-only
17518 * @providesModule cloneWithProps
17519 */
17520
17521'use strict';
17522
17523var ReactElement = _dereq_(57);
17524var ReactPropTransferer = _dereq_(79);
17525
17526var keyOf = _dereq_(166);
17527var warning = _dereq_(173);
17528
17529var CHILDREN_PROP = keyOf({ children: null });
17530
17531var didDeprecatedWarn = false;
17532
17533/**
17534 * Sometimes you want to change the props of a child passed to you. Usually
17535 * this is to add a CSS class.
17536 *
17537 * @param {ReactElement} child child element you'd like to clone
17538 * @param {object} props props you'd like to modify. className and style will be
17539 * merged automatically.
17540 * @return {ReactElement} a clone of child with props merged in.
17541 * @deprecated
17542 */
17543function cloneWithProps(child, props) {
17544 if ("development" !== 'production') {
17545 "development" !== 'production' ? warning(didDeprecatedWarn, 'cloneWithProps(...) is deprecated. ' + 'Please use React.cloneElement instead.') : undefined;
17546 didDeprecatedWarn = true;
17547 "development" !== 'production' ? warning(!child.ref, 'You are calling cloneWithProps() on a child with a ref. This is ' + 'dangerous because you\'re creating a new child which will not be ' + 'added as a ref to its parent.') : undefined;
17548 }
17549
17550 var newProps = ReactPropTransferer.mergeProps(props, child.props);
17551
17552 // Use `child.props.children` if it is provided.
17553 if (!newProps.hasOwnProperty(CHILDREN_PROP) && child.props.hasOwnProperty(CHILDREN_PROP)) {
17554 newProps.children = child.props.children;
17555 }
17556
17557 // The current API doesn't retain _owner, which is why this
17558 // doesn't use ReactElement.cloneAndReplaceProps.
17559 return ReactElement.createElement(child.type, newProps);
17560}
17561
17562module.exports = cloneWithProps;
17563},{"166":166,"173":173,"57":57,"79":79}],119:[function(_dereq_,module,exports){
17564/**
17565 * Copyright 2013-2015, Facebook, Inc.
17566 * All rights reserved.
17567 *
17568 * This source code is licensed under the BSD-style license found in the
17569 * LICENSE file in the root directory of this source tree. An additional grant
17570 * of patent rights can be found in the PATENTS file in the same directory.
17571 *
17572 * @providesModule dangerousStyleValue
17573 * @typechecks static-only
17574 */
17575
17576'use strict';
17577
17578var CSSProperty = _dereq_(4);
17579
17580var isUnitlessNumber = CSSProperty.isUnitlessNumber;
17581
17582/**
17583 * Convert a value into the proper css writable value. The style name `name`
17584 * should be logical (no hyphens), as specified
17585 * in `CSSProperty.isUnitlessNumber`.
17586 *
17587 * @param {string} name CSS property name such as `topMargin`.
17588 * @param {*} value CSS property value such as `10px`.
17589 * @return {string} Normalized style value with dimensions applied.
17590 */
17591function dangerousStyleValue(name, value) {
17592 // Note that we've removed escapeTextForBrowser() calls here since the
17593 // whole string will be escaped when the attribute is injected into
17594 // the markup. If you provide unsafe user data here they can inject
17595 // arbitrary CSS which may be problematic (I couldn't repro this):
17596 // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
17597 // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/
17598 // This is not an XSS hole but instead a potential CSS injection issue
17599 // which has lead to a greater discussion about how we're going to
17600 // trust URLs moving forward. See #2115901
17601
17602 var isEmpty = value == null || typeof value === 'boolean' || value === '';
17603 if (isEmpty) {
17604 return '';
17605 }
17606
17607 var isNonNumeric = isNaN(value);
17608 if (isNonNumeric || value === 0 || isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name]) {
17609 return '' + value; // cast to string
17610 }
17611
17612 if (typeof value === 'string') {
17613 value = value.trim();
17614 }
17615 return value + 'px';
17616}
17617
17618module.exports = dangerousStyleValue;
17619},{"4":4}],120:[function(_dereq_,module,exports){
17620/**
17621 * Copyright 2013-2015, Facebook, Inc.
17622 * All rights reserved.
17623 *
17624 * This source code is licensed under the BSD-style license found in the
17625 * LICENSE file in the root directory of this source tree. An additional grant
17626 * of patent rights can be found in the PATENTS file in the same directory.
17627 *
17628 * @providesModule deprecated
17629 */
17630
17631'use strict';
17632
17633var assign = _dereq_(24);
17634var warning = _dereq_(173);
17635
17636/**
17637 * This will log a single deprecation notice per function and forward the call
17638 * on to the new API.
17639 *
17640 * @param {string} fnName The name of the function
17641 * @param {string} newModule The module that fn will exist in
17642 * @param {string} newPackage The module that fn will exist in
17643 * @param {*} ctx The context this forwarded call should run in
17644 * @param {function} fn The function to forward on to
17645 * @return {function} The function that will warn once and then call fn
17646 */
17647function deprecated(fnName, newModule, newPackage, ctx, fn) {
17648 var warned = false;
17649 if ("development" !== 'production') {
17650 var newFn = function () {
17651 "development" !== 'production' ? warning(warned,
17652 // Require examples in this string must be split to prevent React's
17653 // build tools from mistaking them for real requires.
17654 // Otherwise the build tools will attempt to build a '%s' module.
17655 'React.%s is deprecated. Please use %s.%s from require' + '(\'%s\') ' + 'instead.', fnName, newModule, fnName, newPackage) : undefined;
17656 warned = true;
17657 return fn.apply(ctx, arguments);
17658 };
17659 // We need to make sure all properties of the original fn are copied over.
17660 // In particular, this is needed to support PropTypes
17661 return assign(newFn, fn);
17662 }
17663
17664 return fn;
17665}
17666
17667module.exports = deprecated;
17668},{"173":173,"24":24}],121:[function(_dereq_,module,exports){
17669/**
17670 * Copyright 2013-2015, Facebook, Inc.
17671 * All rights reserved.
17672 *
17673 * This source code is licensed under the BSD-style license found in the
17674 * LICENSE file in the root directory of this source tree. An additional grant
17675 * of patent rights can be found in the PATENTS file in the same directory.
17676 *
17677 * @providesModule escapeTextContentForBrowser
17678 */
17679
17680'use strict';
17681
17682var ESCAPE_LOOKUP = {
17683 '&': '&',
17684 '>': '>',
17685 '<': '<',
17686 '"': '"',
17687 '\'': '''
17688};
17689
17690var ESCAPE_REGEX = /[&><"']/g;
17691
17692function escaper(match) {
17693 return ESCAPE_LOOKUP[match];
17694}
17695
17696/**
17697 * Escapes text to prevent scripting attacks.
17698 *
17699 * @param {*} text Text value to escape.
17700 * @return {string} An escaped string.
17701 */
17702function escapeTextContentForBrowser(text) {
17703 return ('' + text).replace(ESCAPE_REGEX, escaper);
17704}
17705
17706module.exports = escapeTextContentForBrowser;
17707},{}],122:[function(_dereq_,module,exports){
17708/**
17709 * Copyright 2013-2015, Facebook, Inc.
17710 * All rights reserved.
17711 *
17712 * This source code is licensed under the BSD-style license found in the
17713 * LICENSE file in the root directory of this source tree. An additional grant
17714 * of patent rights can be found in the PATENTS file in the same directory.
17715 *
17716 * @providesModule findDOMNode
17717 * @typechecks static-only
17718 */
17719
17720'use strict';
17721
17722var ReactCurrentOwner = _dereq_(39);
17723var ReactInstanceMap = _dereq_(68);
17724var ReactMount = _dereq_(72);
17725
17726var invariant = _dereq_(161);
17727var warning = _dereq_(173);
17728
17729/**
17730 * Returns the DOM node rendered by this element.
17731 *
17732 * @param {ReactComponent|DOMElement} componentOrElement
17733 * @return {?DOMElement} The root node of this element.
17734 */
17735function findDOMNode(componentOrElement) {
17736 if ("development" !== 'production') {
17737 var owner = ReactCurrentOwner.current;
17738 if (owner !== null) {
17739 "development" !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing getDOMNode or findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : undefined;
17740 owner._warnedAboutRefsInRender = true;
17741 }
17742 }
17743 if (componentOrElement == null) {
17744 return null;
17745 }
17746 if (componentOrElement.nodeType === 1) {
17747 return componentOrElement;
17748 }
17749 if (ReactInstanceMap.has(componentOrElement)) {
17750 return ReactMount.getNodeFromInstance(componentOrElement);
17751 }
17752 !(componentOrElement.render == null || typeof componentOrElement.render !== 'function') ? "development" !== 'production' ? invariant(false, 'findDOMNode was called on an unmounted component.') : invariant(false) : undefined;
17753 !false ? "development" !== 'production' ? invariant(false, 'Element appears to be neither ReactComponent nor DOMNode (keys: %s)', Object.keys(componentOrElement)) : invariant(false) : undefined;
17754}
17755
17756module.exports = findDOMNode;
17757},{"161":161,"173":173,"39":39,"68":68,"72":72}],123:[function(_dereq_,module,exports){
17758/**
17759 * Copyright 2013-2015, Facebook, Inc.
17760 * All rights reserved.
17761 *
17762 * This source code is licensed under the BSD-style license found in the
17763 * LICENSE file in the root directory of this source tree. An additional grant
17764 * of patent rights can be found in the PATENTS file in the same directory.
17765 *
17766 * @providesModule flattenChildren
17767 */
17768
17769'use strict';
17770
17771var traverseAllChildren = _dereq_(142);
17772var warning = _dereq_(173);
17773
17774/**
17775 * @param {function} traverseContext Context passed through traversal.
17776 * @param {?ReactComponent} child React child component.
17777 * @param {!string} name String name of key path to child.
17778 */
17779function flattenSingleChildIntoContext(traverseContext, child, name) {
17780 // We found a component instance.
17781 var result = traverseContext;
17782 var keyUnique = result[name] === undefined;
17783 if ("development" !== 'production') {
17784 "development" !== 'production' ? warning(keyUnique, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.', name) : undefined;
17785 }
17786 if (keyUnique && child != null) {
17787 result[name] = child;
17788 }
17789}
17790
17791/**
17792 * Flattens children that are typically specified as `props.children`. Any null
17793 * children will not be included in the resulting object.
17794 * @return {!object} flattened children keyed by name.
17795 */
17796function flattenChildren(children) {
17797 if (children == null) {
17798 return children;
17799 }
17800 var result = {};
17801 traverseAllChildren(children, flattenSingleChildIntoContext, result);
17802 return result;
17803}
17804
17805module.exports = flattenChildren;
17806},{"142":142,"173":173}],124:[function(_dereq_,module,exports){
17807/**
17808 * Copyright 2013-2015, Facebook, Inc.
17809 * All rights reserved.
17810 *
17811 * This source code is licensed under the BSD-style license found in the
17812 * LICENSE file in the root directory of this source tree. An additional grant
17813 * of patent rights can be found in the PATENTS file in the same directory.
17814 *
17815 * @providesModule forEachAccumulated
17816 */
17817
17818'use strict';
17819
17820/**
17821 * @param {array} arr an "accumulation" of items which is either an Array or
17822 * a single item. Useful when paired with the `accumulate` module. This is a
17823 * simple utility that allows us to reason about a collection of items, but
17824 * handling the case when there is exactly one item (and we do not need to
17825 * allocate an array).
17826 */
17827var forEachAccumulated = function (arr, cb, scope) {
17828 if (Array.isArray(arr)) {
17829 arr.forEach(cb, scope);
17830 } else if (arr) {
17831 cb.call(scope, arr);
17832 }
17833};
17834
17835module.exports = forEachAccumulated;
17836},{}],125:[function(_dereq_,module,exports){
17837/**
17838 * Copyright 2013-2015, Facebook, Inc.
17839 * All rights reserved.
17840 *
17841 * This source code is licensed under the BSD-style license found in the
17842 * LICENSE file in the root directory of this source tree. An additional grant
17843 * of patent rights can be found in the PATENTS file in the same directory.
17844 *
17845 * @providesModule getEventCharCode
17846 * @typechecks static-only
17847 */
17848
17849'use strict';
17850
17851/**
17852 * `charCode` represents the actual "character code" and is safe to use with
17853 * `String.fromCharCode`. As such, only keys that correspond to printable
17854 * characters produce a valid `charCode`, the only exception to this is Enter.
17855 * The Tab-key is considered non-printable and does not have a `charCode`,
17856 * presumably because it does not produce a tab-character in browsers.
17857 *
17858 * @param {object} nativeEvent Native browser event.
17859 * @return {number} Normalized `charCode` property.
17860 */
17861function getEventCharCode(nativeEvent) {
17862 var charCode;
17863 var keyCode = nativeEvent.keyCode;
17864
17865 if ('charCode' in nativeEvent) {
17866 charCode = nativeEvent.charCode;
17867
17868 // FF does not set `charCode` for the Enter-key, check against `keyCode`.
17869 if (charCode === 0 && keyCode === 13) {
17870 charCode = 13;
17871 }
17872 } else {
17873 // IE8 does not implement `charCode`, but `keyCode` has the correct value.
17874 charCode = keyCode;
17875 }
17876
17877 // Some non-printable keys are reported in `charCode`/`keyCode`, discard them.
17878 // Must not discard the (non-)printable Enter-key.
17879 if (charCode >= 32 || charCode === 13) {
17880 return charCode;
17881 }
17882
17883 return 0;
17884}
17885
17886module.exports = getEventCharCode;
17887},{}],126:[function(_dereq_,module,exports){
17888/**
17889 * Copyright 2013-2015, Facebook, Inc.
17890 * All rights reserved.
17891 *
17892 * This source code is licensed under the BSD-style license found in the
17893 * LICENSE file in the root directory of this source tree. An additional grant
17894 * of patent rights can be found in the PATENTS file in the same directory.
17895 *
17896 * @providesModule getEventKey
17897 * @typechecks static-only
17898 */
17899
17900'use strict';
17901
17902var getEventCharCode = _dereq_(125);
17903
17904/**
17905 * Normalization of deprecated HTML5 `key` values
17906 * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
17907 */
17908var normalizeKey = {
17909 'Esc': 'Escape',
17910 'Spacebar': ' ',
17911 'Left': 'ArrowLeft',
17912 'Up': 'ArrowUp',
17913 'Right': 'ArrowRight',
17914 'Down': 'ArrowDown',
17915 'Del': 'Delete',
17916 'Win': 'OS',
17917 'Menu': 'ContextMenu',
17918 'Apps': 'ContextMenu',
17919 'Scroll': 'ScrollLock',
17920 'MozPrintableKey': 'Unidentified'
17921};
17922
17923/**
17924 * Translation from legacy `keyCode` to HTML5 `key`
17925 * Only special keys supported, all others depend on keyboard layout or browser
17926 * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
17927 */
17928var translateToKey = {
17929 8: 'Backspace',
17930 9: 'Tab',
17931 12: 'Clear',
17932 13: 'Enter',
17933 16: 'Shift',
17934 17: 'Control',
17935 18: 'Alt',
17936 19: 'Pause',
17937 20: 'CapsLock',
17938 27: 'Escape',
17939 32: ' ',
17940 33: 'PageUp',
17941 34: 'PageDown',
17942 35: 'End',
17943 36: 'Home',
17944 37: 'ArrowLeft',
17945 38: 'ArrowUp',
17946 39: 'ArrowRight',
17947 40: 'ArrowDown',
17948 45: 'Insert',
17949 46: 'Delete',
17950 112: 'F1', 113: 'F2', 114: 'F3', 115: 'F4', 116: 'F5', 117: 'F6',
17951 118: 'F7', 119: 'F8', 120: 'F9', 121: 'F10', 122: 'F11', 123: 'F12',
17952 144: 'NumLock',
17953 145: 'ScrollLock',
17954 224: 'Meta'
17955};
17956
17957/**
17958 * @param {object} nativeEvent Native browser event.
17959 * @return {string} Normalized `key` property.
17960 */
17961function getEventKey(nativeEvent) {
17962 if (nativeEvent.key) {
17963 // Normalize inconsistent values reported by browsers due to
17964 // implementations of a working draft specification.
17965
17966 // FireFox implements `key` but returns `MozPrintableKey` for all
17967 // printable characters (normalized to `Unidentified`), ignore it.
17968 var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
17969 if (key !== 'Unidentified') {
17970 return key;
17971 }
17972 }
17973
17974 // Browser does not implement `key`, polyfill as much of it as we can.
17975 if (nativeEvent.type === 'keypress') {
17976 var charCode = getEventCharCode(nativeEvent);
17977
17978 // The enter-key is technically both printable and non-printable and can
17979 // thus be captured by `keypress`, no other non-printable key should.
17980 return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);
17981 }
17982 if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {
17983 // While user keyboard layout determines the actual meaning of each
17984 // `keyCode` value, almost all function keys have a universal value.
17985 return translateToKey[nativeEvent.keyCode] || 'Unidentified';
17986 }
17987 return '';
17988}
17989
17990module.exports = getEventKey;
17991},{"125":125}],127:[function(_dereq_,module,exports){
17992/**
17993 * Copyright 2013-2015, Facebook, Inc.
17994 * All rights reserved.
17995 *
17996 * This source code is licensed under the BSD-style license found in the
17997 * LICENSE file in the root directory of this source tree. An additional grant
17998 * of patent rights can be found in the PATENTS file in the same directory.
17999 *
18000 * @providesModule getEventModifierState
18001 * @typechecks static-only
18002 */
18003
18004'use strict';
18005
18006/**
18007 * Translation from modifier key to the associated property in the event.
18008 * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers
18009 */
18010
18011var modifierKeyToProp = {
18012 'Alt': 'altKey',
18013 'Control': 'ctrlKey',
18014 'Meta': 'metaKey',
18015 'Shift': 'shiftKey'
18016};
18017
18018// IE8 does not implement getModifierState so we simply map it to the only
18019// modifier keys exposed by the event itself, does not support Lock-keys.
18020// Currently, all major browsers except Chrome seems to support Lock-keys.
18021function modifierStateGetter(keyArg) {
18022 var syntheticEvent = this;
18023 var nativeEvent = syntheticEvent.nativeEvent;
18024 if (nativeEvent.getModifierState) {
18025 return nativeEvent.getModifierState(keyArg);
18026 }
18027 var keyProp = modifierKeyToProp[keyArg];
18028 return keyProp ? !!nativeEvent[keyProp] : false;
18029}
18030
18031function getEventModifierState(nativeEvent) {
18032 return modifierStateGetter;
18033}
18034
18035module.exports = getEventModifierState;
18036},{}],128:[function(_dereq_,module,exports){
18037/**
18038 * Copyright 2013-2015, Facebook, Inc.
18039 * All rights reserved.
18040 *
18041 * This source code is licensed under the BSD-style license found in the
18042 * LICENSE file in the root directory of this source tree. An additional grant
18043 * of patent rights can be found in the PATENTS file in the same directory.
18044 *
18045 * @providesModule getEventTarget
18046 * @typechecks static-only
18047 */
18048
18049'use strict';
18050
18051/**
18052 * Gets the target node from a native browser event by accounting for
18053 * inconsistencies in browser DOM APIs.
18054 *
18055 * @param {object} nativeEvent Native browser event.
18056 * @return {DOMEventTarget} Target node.
18057 */
18058function getEventTarget(nativeEvent) {
18059 var target = nativeEvent.target || nativeEvent.srcElement || window;
18060 // Safari may fire events on text nodes (Node.TEXT_NODE is 3).
18061 // @see http://www.quirksmode.org/js/events_properties.html
18062 return target.nodeType === 3 ? target.parentNode : target;
18063}
18064
18065module.exports = getEventTarget;
18066},{}],129:[function(_dereq_,module,exports){
18067/**
18068 * Copyright 2013-2015, Facebook, Inc.
18069 * All rights reserved.
18070 *
18071 * This source code is licensed under the BSD-style license found in the
18072 * LICENSE file in the root directory of this source tree. An additional grant
18073 * of patent rights can be found in the PATENTS file in the same directory.
18074 *
18075 * @providesModule getIteratorFn
18076 * @typechecks static-only
18077 */
18078
18079'use strict';
18080
18081/* global Symbol */
18082var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
18083var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
18084
18085/**
18086 * Returns the iterator method function contained on the iterable object.
18087 *
18088 * Be sure to invoke the function with the iterable as context:
18089 *
18090 * var iteratorFn = getIteratorFn(myIterable);
18091 * if (iteratorFn) {
18092 * var iterator = iteratorFn.call(myIterable);
18093 * ...
18094 * }
18095 *
18096 * @param {?object} maybeIterable
18097 * @return {?function}
18098 */
18099function getIteratorFn(maybeIterable) {
18100 var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
18101 if (typeof iteratorFn === 'function') {
18102 return iteratorFn;
18103 }
18104}
18105
18106module.exports = getIteratorFn;
18107},{}],130:[function(_dereq_,module,exports){
18108/**
18109 * Copyright 2013-2015, Facebook, Inc.
18110 * All rights reserved.
18111 *
18112 * This source code is licensed under the BSD-style license found in the
18113 * LICENSE file in the root directory of this source tree. An additional grant
18114 * of patent rights can be found in the PATENTS file in the same directory.
18115 *
18116 * @providesModule getNodeForCharacterOffset
18117 */
18118
18119'use strict';
18120
18121/**
18122 * Given any node return the first leaf node without children.
18123 *
18124 * @param {DOMElement|DOMTextNode} node
18125 * @return {DOMElement|DOMTextNode}
18126 */
18127function getLeafNode(node) {
18128 while (node && node.firstChild) {
18129 node = node.firstChild;
18130 }
18131 return node;
18132}
18133
18134/**
18135 * Get the next sibling within a container. This will walk up the
18136 * DOM if a node's siblings have been exhausted.
18137 *
18138 * @param {DOMElement|DOMTextNode} node
18139 * @return {?DOMElement|DOMTextNode}
18140 */
18141function getSiblingNode(node) {
18142 while (node) {
18143 if (node.nextSibling) {
18144 return node.nextSibling;
18145 }
18146 node = node.parentNode;
18147 }
18148}
18149
18150/**
18151 * Get object describing the nodes which contain characters at offset.
18152 *
18153 * @param {DOMElement|DOMTextNode} root
18154 * @param {number} offset
18155 * @return {?object}
18156 */
18157function getNodeForCharacterOffset(root, offset) {
18158 var node = getLeafNode(root);
18159 var nodeStart = 0;
18160 var nodeEnd = 0;
18161
18162 while (node) {
18163 if (node.nodeType === 3) {
18164 nodeEnd = nodeStart + node.textContent.length;
18165
18166 if (nodeStart <= offset && nodeEnd >= offset) {
18167 return {
18168 node: node,
18169 offset: offset - nodeStart
18170 };
18171 }
18172
18173 nodeStart = nodeEnd;
18174 }
18175
18176 node = getLeafNode(getSiblingNode(node));
18177 }
18178}
18179
18180module.exports = getNodeForCharacterOffset;
18181},{}],131:[function(_dereq_,module,exports){
18182/**
18183 * Copyright 2013-2015, Facebook, Inc.
18184 * All rights reserved.
18185 *
18186 * This source code is licensed under the BSD-style license found in the
18187 * LICENSE file in the root directory of this source tree. An additional grant
18188 * of patent rights can be found in the PATENTS file in the same directory.
18189 *
18190 * @providesModule getTextContentAccessor
18191 */
18192
18193'use strict';
18194
18195var ExecutionEnvironment = _dereq_(147);
18196
18197var contentKey = null;
18198
18199/**
18200 * Gets the key used to access text content on a DOM node.
18201 *
18202 * @return {?string} Key used to access text content.
18203 * @internal
18204 */
18205function getTextContentAccessor() {
18206 if (!contentKey && ExecutionEnvironment.canUseDOM) {
18207 // Prefer textContent to innerText because many browsers support both but
18208 // SVG <text> elements don't support innerText even when <div> does.
18209 contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText';
18210 }
18211 return contentKey;
18212}
18213
18214module.exports = getTextContentAccessor;
18215},{"147":147}],132:[function(_dereq_,module,exports){
18216/**
18217 * Copyright 2013-2015, Facebook, Inc.
18218 * All rights reserved.
18219 *
18220 * This source code is licensed under the BSD-style license found in the
18221 * LICENSE file in the root directory of this source tree. An additional grant
18222 * of patent rights can be found in the PATENTS file in the same directory.
18223 *
18224 * @providesModule instantiateReactComponent
18225 * @typechecks static-only
18226 */
18227
18228'use strict';
18229
18230var ReactCompositeComponent = _dereq_(38);
18231var ReactEmptyComponent = _dereq_(59);
18232var ReactNativeComponent = _dereq_(75);
18233
18234var assign = _dereq_(24);
18235var invariant = _dereq_(161);
18236var warning = _dereq_(173);
18237
18238// To avoid a cyclic dependency, we create the final class in this module
18239var ReactCompositeComponentWrapper = function () {};
18240assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent.Mixin, {
18241 _instantiateReactComponent: instantiateReactComponent
18242});
18243
18244function getDeclarationErrorAddendum(owner) {
18245 if (owner) {
18246 var name = owner.getName();
18247 if (name) {
18248 return ' Check the render method of `' + name + '`.';
18249 }
18250 }
18251 return '';
18252}
18253
18254/**
18255 * Check if the type reference is a known internal type. I.e. not a user
18256 * provided composite type.
18257 *
18258 * @param {function} type
18259 * @return {boolean} Returns true if this is a valid internal type.
18260 */
18261function isInternalComponentType(type) {
18262 return typeof type === 'function' && typeof type.prototype !== 'undefined' && typeof type.prototype.mountComponent === 'function' && typeof type.prototype.receiveComponent === 'function';
18263}
18264
18265/**
18266 * Given a ReactNode, create an instance that will actually be mounted.
18267 *
18268 * @param {ReactNode} node
18269 * @return {object} A new instance of the element's constructor.
18270 * @protected
18271 */
18272function instantiateReactComponent(node) {
18273 var instance;
18274
18275 if (node === null || node === false) {
18276 instance = new ReactEmptyComponent(instantiateReactComponent);
18277 } else if (typeof node === 'object') {
18278 var element = node;
18279 !(element && (typeof element.type === 'function' || typeof element.type === 'string')) ? "development" !== 'production' ? invariant(false, 'Element type is invalid: expected a string (for built-in components) ' + 'or a class/function (for composite components) but got: %s.%s', element.type == null ? element.type : typeof element.type, getDeclarationErrorAddendum(element._owner)) : invariant(false) : undefined;
18280
18281 // Special case string values
18282 if (typeof element.type === 'string') {
18283 instance = ReactNativeComponent.createInternalComponent(element);
18284 } else if (isInternalComponentType(element.type)) {
18285 // This is temporarily available for custom components that are not string
18286 // representations. I.e. ART. Once those are updated to use the string
18287 // representation, we can drop this code path.
18288 instance = new element.type(element);
18289 } else {
18290 instance = new ReactCompositeComponentWrapper();
18291 }
18292 } else if (typeof node === 'string' || typeof node === 'number') {
18293 instance = ReactNativeComponent.createInstanceForText(node);
18294 } else {
18295 !false ? "development" !== 'production' ? invariant(false, 'Encountered invalid React node of type %s', typeof node) : invariant(false) : undefined;
18296 }
18297
18298 if ("development" !== 'production') {
18299 "development" !== 'production' ? warning(typeof instance.construct === 'function' && typeof instance.mountComponent === 'function' && typeof instance.receiveComponent === 'function' && typeof instance.unmountComponent === 'function', 'Only React Components can be mounted.') : undefined;
18300 }
18301
18302 // Sets up the instance. This can probably just move into the constructor now.
18303 instance.construct(node);
18304
18305 // These two fields are used by the DOM and ART diffing algorithms
18306 // respectively. Instead of using expandos on components, we should be
18307 // storing the state needed by the diffing algorithms elsewhere.
18308 instance._mountIndex = 0;
18309 instance._mountImage = null;
18310
18311 if ("development" !== 'production') {
18312 instance._isOwnerNecessary = false;
18313 instance._warnedAboutRefsInRender = false;
18314 }
18315
18316 // Internal instances should fully constructed at this point, so they should
18317 // not get any new fields added to them at this point.
18318 if ("development" !== 'production') {
18319 if (Object.preventExtensions) {
18320 Object.preventExtensions(instance);
18321 }
18322 }
18323
18324 return instance;
18325}
18326
18327module.exports = instantiateReactComponent;
18328},{"161":161,"173":173,"24":24,"38":38,"59":59,"75":75}],133:[function(_dereq_,module,exports){
18329/**
18330 * Copyright 2013-2015, Facebook, Inc.
18331 * All rights reserved.
18332 *
18333 * This source code is licensed under the BSD-style license found in the
18334 * LICENSE file in the root directory of this source tree. An additional grant
18335 * of patent rights can be found in the PATENTS file in the same directory.
18336 *
18337 * @providesModule isEventSupported
18338 */
18339
18340'use strict';
18341
18342var ExecutionEnvironment = _dereq_(147);
18343
18344var useHasFeature;
18345if (ExecutionEnvironment.canUseDOM) {
18346 useHasFeature = document.implementation && document.implementation.hasFeature &&
18347 // always returns true in newer browsers as per the standard.
18348 // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
18349 document.implementation.hasFeature('', '') !== true;
18350}
18351
18352/**
18353 * Checks if an event is supported in the current execution environment.
18354 *
18355 * NOTE: This will not work correctly for non-generic events such as `change`,
18356 * `reset`, `load`, `error`, and `select`.
18357 *
18358 * Borrows from Modernizr.
18359 *
18360 * @param {string} eventNameSuffix Event name, e.g. "click".
18361 * @param {?boolean} capture Check if the capture phase is supported.
18362 * @return {boolean} True if the event is supported.
18363 * @internal
18364 * @license Modernizr 3.0.0pre (Custom Build) | MIT
18365 */
18366function isEventSupported(eventNameSuffix, capture) {
18367 if (!ExecutionEnvironment.canUseDOM || capture && !('addEventListener' in document)) {
18368 return false;
18369 }
18370
18371 var eventName = 'on' + eventNameSuffix;
18372 var isSupported = (eventName in document);
18373
18374 if (!isSupported) {
18375 var element = document.createElement('div');
18376 element.setAttribute(eventName, 'return;');
18377 isSupported = typeof element[eventName] === 'function';
18378 }
18379
18380 if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') {
18381 // This is the only way to test support for the `wheel` event in IE9+.
18382 isSupported = document.implementation.hasFeature('Events.wheel', '3.0');
18383 }
18384
18385 return isSupported;
18386}
18387
18388module.exports = isEventSupported;
18389},{"147":147}],134:[function(_dereq_,module,exports){
18390/**
18391 * Copyright 2013-2015, Facebook, Inc.
18392 * All rights reserved.
18393 *
18394 * This source code is licensed under the BSD-style license found in the
18395 * LICENSE file in the root directory of this source tree. An additional grant
18396 * of patent rights can be found in the PATENTS file in the same directory.
18397 *
18398 * @providesModule isTextInputElement
18399 */
18400
18401'use strict';
18402
18403/**
18404 * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
18405 */
18406var supportedInputTypes = {
18407 'color': true,
18408 'date': true,
18409 'datetime': true,
18410 'datetime-local': true,
18411 'email': true,
18412 'month': true,
18413 'number': true,
18414 'password': true,
18415 'range': true,
18416 'search': true,
18417 'tel': true,
18418 'text': true,
18419 'time': true,
18420 'url': true,
18421 'week': true
18422};
18423
18424function isTextInputElement(elem) {
18425 var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
18426 return nodeName && (nodeName === 'input' && supportedInputTypes[elem.type] || nodeName === 'textarea');
18427}
18428
18429module.exports = isTextInputElement;
18430},{}],135:[function(_dereq_,module,exports){
18431/**
18432 * Copyright 2013-2015, Facebook, Inc.
18433 * All rights reserved.
18434 *
18435 * This source code is licensed under the BSD-style license found in the
18436 * LICENSE file in the root directory of this source tree. An additional grant
18437 * of patent rights can be found in the PATENTS file in the same directory.
18438 *
18439 * @providesModule onlyChild
18440 */
18441'use strict';
18442
18443var ReactElement = _dereq_(57);
18444
18445var invariant = _dereq_(161);
18446
18447/**
18448 * Returns the first child in a collection of children and verifies that there
18449 * is only one child in the collection. The current implementation of this
18450 * function assumes that a single child gets passed without a wrapper, but the
18451 * purpose of this helper function is to abstract away the particular structure
18452 * of children.
18453 *
18454 * @param {?object} children Child collection structure.
18455 * @return {ReactComponent} The first and only `ReactComponent` contained in the
18456 * structure.
18457 */
18458function onlyChild(children) {
18459 !ReactElement.isValidElement(children) ? "development" !== 'production' ? invariant(false, 'onlyChild must be passed a children with exactly one child.') : invariant(false) : undefined;
18460 return children;
18461}
18462
18463module.exports = onlyChild;
18464},{"161":161,"57":57}],136:[function(_dereq_,module,exports){
18465/**
18466 * Copyright 2013-2015, Facebook, Inc.
18467 * All rights reserved.
18468 *
18469 * This source code is licensed under the BSD-style license found in the
18470 * LICENSE file in the root directory of this source tree. An additional grant
18471 * of patent rights can be found in the PATENTS file in the same directory.
18472 *
18473 * @providesModule quoteAttributeValueForBrowser
18474 */
18475
18476'use strict';
18477
18478var escapeTextContentForBrowser = _dereq_(121);
18479
18480/**
18481 * Escapes attribute value to prevent scripting attacks.
18482 *
18483 * @param {*} value Value to escape.
18484 * @return {string} An escaped string.
18485 */
18486function quoteAttributeValueForBrowser(value) {
18487 return '"' + escapeTextContentForBrowser(value) + '"';
18488}
18489
18490module.exports = quoteAttributeValueForBrowser;
18491},{"121":121}],137:[function(_dereq_,module,exports){
18492/**
18493 * Copyright 2013-2015, Facebook, Inc.
18494 * All rights reserved.
18495 *
18496 * This source code is licensed under the BSD-style license found in the
18497 * LICENSE file in the root directory of this source tree. An additional grant
18498 * of patent rights can be found in the PATENTS file in the same directory.
18499 *
18500* @providesModule renderSubtreeIntoContainer
18501*/
18502
18503'use strict';
18504
18505var ReactMount = _dereq_(72);
18506
18507module.exports = ReactMount.renderSubtreeIntoContainer;
18508},{"72":72}],138:[function(_dereq_,module,exports){
18509/**
18510 * Copyright 2013-2015, Facebook, Inc.
18511 * All rights reserved.
18512 *
18513 * This source code is licensed under the BSD-style license found in the
18514 * LICENSE file in the root directory of this source tree. An additional grant
18515 * of patent rights can be found in the PATENTS file in the same directory.
18516 *
18517 * @providesModule setInnerHTML
18518 */
18519
18520/* globals MSApp */
18521
18522'use strict';
18523
18524var ExecutionEnvironment = _dereq_(147);
18525
18526var WHITESPACE_TEST = /^[ \r\n\t\f]/;
18527var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/;
18528
18529/**
18530 * Set the innerHTML property of a node, ensuring that whitespace is preserved
18531 * even in IE8.
18532 *
18533 * @param {DOMElement} node
18534 * @param {string} html
18535 * @internal
18536 */
18537var setInnerHTML = function (node, html) {
18538 node.innerHTML = html;
18539};
18540
18541// Win8 apps: Allow all html to be inserted
18542if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
18543 setInnerHTML = function (node, html) {
18544 MSApp.execUnsafeLocalFunction(function () {
18545 node.innerHTML = html;
18546 });
18547 };
18548}
18549
18550if (ExecutionEnvironment.canUseDOM) {
18551 // IE8: When updating a just created node with innerHTML only leading
18552 // whitespace is removed. When updating an existing node with innerHTML
18553 // whitespace in root TextNodes is also collapsed.
18554 // @see quirksmode.org/bugreports/archives/2004/11/innerhtml_and_t.html
18555
18556 // Feature detection; only IE8 is known to behave improperly like this.
18557 var testElement = document.createElement('div');
18558 testElement.innerHTML = ' ';
18559 if (testElement.innerHTML === '') {
18560 setInnerHTML = function (node, html) {
18561 // Magic theory: IE8 supposedly differentiates between added and updated
18562 // nodes when processing innerHTML, innerHTML on updated nodes suffers
18563 // from worse whitespace behavior. Re-adding a node like this triggers
18564 // the initial and more favorable whitespace behavior.
18565 // TODO: What to do on a detached node?
18566 if (node.parentNode) {
18567 node.parentNode.replaceChild(node, node);
18568 }
18569
18570 // We also implement a workaround for non-visible tags disappearing into
18571 // thin air on IE8, this only happens if there is no visible text
18572 // in-front of the non-visible tags. Piggyback on the whitespace fix
18573 // and simply check if any non-visible tags appear in the source.
18574 if (WHITESPACE_TEST.test(html) || html[0] === '<' && NONVISIBLE_TEST.test(html)) {
18575 // Recover leading whitespace by temporarily prepending any character.
18576 // \uFEFF has the potential advantage of being zero-width/invisible.
18577 // UglifyJS drops U+FEFF chars when parsing, so use String.fromCharCode
18578 // in hopes that this is preserved even if "\uFEFF" is transformed to
18579 // the actual Unicode character (by Babel, for example).
18580 // https://github.com/mishoo/UglifyJS2/blob/v2.4.20/lib/parse.js#L216
18581 node.innerHTML = String.fromCharCode(0xFEFF) + html;
18582
18583 // deleteData leaves an empty `TextNode` which offsets the index of all
18584 // children. Definitely want to avoid this.
18585 var textNode = node.firstChild;
18586 if (textNode.data.length === 1) {
18587 node.removeChild(textNode);
18588 } else {
18589 textNode.deleteData(0, 1);
18590 }
18591 } else {
18592 node.innerHTML = html;
18593 }
18594 };
18595 }
18596}
18597
18598module.exports = setInnerHTML;
18599},{"147":147}],139:[function(_dereq_,module,exports){
18600/**
18601 * Copyright 2013-2015, Facebook, Inc.
18602 * All rights reserved.
18603 *
18604 * This source code is licensed under the BSD-style license found in the
18605 * LICENSE file in the root directory of this source tree. An additional grant
18606 * of patent rights can be found in the PATENTS file in the same directory.
18607 *
18608 * @providesModule setTextContent
18609 */
18610
18611'use strict';
18612
18613var ExecutionEnvironment = _dereq_(147);
18614var escapeTextContentForBrowser = _dereq_(121);
18615var setInnerHTML = _dereq_(138);
18616
18617/**
18618 * Set the textContent property of a node, ensuring that whitespace is preserved
18619 * even in IE8. innerText is a poor substitute for textContent and, among many
18620 * issues, inserts <br> instead of the literal newline chars. innerHTML behaves
18621 * as it should.
18622 *
18623 * @param {DOMElement} node
18624 * @param {string} text
18625 * @internal
18626 */
18627var setTextContent = function (node, text) {
18628 node.textContent = text;
18629};
18630
18631if (ExecutionEnvironment.canUseDOM) {
18632 if (!('textContent' in document.documentElement)) {
18633 setTextContent = function (node, text) {
18634 setInnerHTML(node, escapeTextContentForBrowser(text));
18635 };
18636 }
18637}
18638
18639module.exports = setTextContent;
18640},{"121":121,"138":138,"147":147}],140:[function(_dereq_,module,exports){
18641/**
18642 * Copyright 2013-2015, Facebook, Inc.
18643 * All rights reserved.
18644 *
18645 * This source code is licensed under the BSD-style license found in the
18646 * LICENSE file in the root directory of this source tree. An additional grant
18647 * of patent rights can be found in the PATENTS file in the same directory.
18648 *
18649* @providesModule shallowCompare
18650*/
18651
18652'use strict';
18653
18654var shallowEqual = _dereq_(171);
18655
18656/**
18657 * Does a shallow comparison for props and state.
18658 * See ReactComponentWithPureRenderMixin
18659 */
18660function shallowCompare(instance, nextProps, nextState) {
18661 return !shallowEqual(instance.props, nextProps) || !shallowEqual(instance.state, nextState);
18662}
18663
18664module.exports = shallowCompare;
18665},{"171":171}],141:[function(_dereq_,module,exports){
18666/**
18667 * Copyright 2013-2015, Facebook, Inc.
18668 * All rights reserved.
18669 *
18670 * This source code is licensed under the BSD-style license found in the
18671 * LICENSE file in the root directory of this source tree. An additional grant
18672 * of patent rights can be found in the PATENTS file in the same directory.
18673 *
18674 * @providesModule shouldUpdateReactComponent
18675 * @typechecks static-only
18676 */
18677
18678'use strict';
18679
18680/**
18681 * Given a `prevElement` and `nextElement`, determines if the existing
18682 * instance should be updated as opposed to being destroyed or replaced by a new
18683 * instance. Both arguments are elements. This ensures that this logic can
18684 * operate on stateless trees without any backing instance.
18685 *
18686 * @param {?object} prevElement
18687 * @param {?object} nextElement
18688 * @return {boolean} True if the existing instance should be updated.
18689 * @protected
18690 */
18691function shouldUpdateReactComponent(prevElement, nextElement) {
18692 var prevEmpty = prevElement === null || prevElement === false;
18693 var nextEmpty = nextElement === null || nextElement === false;
18694 if (prevEmpty || nextEmpty) {
18695 return prevEmpty === nextEmpty;
18696 }
18697
18698 var prevType = typeof prevElement;
18699 var nextType = typeof nextElement;
18700 if (prevType === 'string' || prevType === 'number') {
18701 return nextType === 'string' || nextType === 'number';
18702 } else {
18703 return nextType === 'object' && prevElement.type === nextElement.type && prevElement.key === nextElement.key;
18704 }
18705 return false;
18706}
18707
18708module.exports = shouldUpdateReactComponent;
18709},{}],142:[function(_dereq_,module,exports){
18710/**
18711 * Copyright 2013-2015, Facebook, Inc.
18712 * All rights reserved.
18713 *
18714 * This source code is licensed under the BSD-style license found in the
18715 * LICENSE file in the root directory of this source tree. An additional grant
18716 * of patent rights can be found in the PATENTS file in the same directory.
18717 *
18718 * @providesModule traverseAllChildren
18719 */
18720
18721'use strict';
18722
18723var ReactCurrentOwner = _dereq_(39);
18724var ReactElement = _dereq_(57);
18725var ReactInstanceHandles = _dereq_(67);
18726
18727var getIteratorFn = _dereq_(129);
18728var invariant = _dereq_(161);
18729var warning = _dereq_(173);
18730
18731var SEPARATOR = ReactInstanceHandles.SEPARATOR;
18732var SUBSEPARATOR = ':';
18733
18734/**
18735 * TODO: Test that a single child and an array with one item have the same key
18736 * pattern.
18737 */
18738
18739var userProvidedKeyEscaperLookup = {
18740 '=': '=0',
18741 '.': '=1',
18742 ':': '=2'
18743};
18744
18745var userProvidedKeyEscapeRegex = /[=.:]/g;
18746
18747var didWarnAboutMaps = false;
18748
18749function userProvidedKeyEscaper(match) {
18750 return userProvidedKeyEscaperLookup[match];
18751}
18752
18753/**
18754 * Generate a key string that identifies a component within a set.
18755 *
18756 * @param {*} component A component that could contain a manual key.
18757 * @param {number} index Index that is used if a manual key is not provided.
18758 * @return {string}
18759 */
18760function getComponentKey(component, index) {
18761 if (component && component.key != null) {
18762 // Explicit key
18763 return wrapUserProvidedKey(component.key);
18764 }
18765 // Implicit key determined by the index in the set
18766 return index.toString(36);
18767}
18768
18769/**
18770 * Escape a component key so that it is safe to use in a reactid.
18771 *
18772 * @param {*} text Component key to be escaped.
18773 * @return {string} An escaped string.
18774 */
18775function escapeUserProvidedKey(text) {
18776 return ('' + text).replace(userProvidedKeyEscapeRegex, userProvidedKeyEscaper);
18777}
18778
18779/**
18780 * Wrap a `key` value explicitly provided by the user to distinguish it from
18781 * implicitly-generated keys generated by a component's index in its parent.
18782 *
18783 * @param {string} key Value of a user-provided `key` attribute
18784 * @return {string}
18785 */
18786function wrapUserProvidedKey(key) {
18787 return '$' + escapeUserProvidedKey(key);
18788}
18789
18790/**
18791 * @param {?*} children Children tree container.
18792 * @param {!string} nameSoFar Name of the key path so far.
18793 * @param {!function} callback Callback to invoke with each child found.
18794 * @param {?*} traverseContext Used to pass information throughout the traversal
18795 * process.
18796 * @return {!number} The number of children in this subtree.
18797 */
18798function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
18799 var type = typeof children;
18800
18801 if (type === 'undefined' || type === 'boolean') {
18802 // All of the above are perceived as null.
18803 children = null;
18804 }
18805
18806 if (children === null || type === 'string' || type === 'number' || ReactElement.isValidElement(children)) {
18807 callback(traverseContext, children,
18808 // If it's the only child, treat the name as if it was wrapped in an array
18809 // so that it's consistent if the number of children grows.
18810 nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
18811 return 1;
18812 }
18813
18814 var child;
18815 var nextName;
18816 var subtreeCount = 0; // Count of children found in the current subtree.
18817 var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
18818
18819 if (Array.isArray(children)) {
18820 for (var i = 0; i < children.length; i++) {
18821 child = children[i];
18822 nextName = nextNamePrefix + getComponentKey(child, i);
18823 subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
18824 }
18825 } else {
18826 var iteratorFn = getIteratorFn(children);
18827 if (iteratorFn) {
18828 var iterator = iteratorFn.call(children);
18829 var step;
18830 if (iteratorFn !== children.entries) {
18831 var ii = 0;
18832 while (!(step = iterator.next()).done) {
18833 child = step.value;
18834 nextName = nextNamePrefix + getComponentKey(child, ii++);
18835 subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
18836 }
18837 } else {
18838 if ("development" !== 'production') {
18839 "development" !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.') : undefined;
18840 didWarnAboutMaps = true;
18841 }
18842 // Iterator will provide entry [k,v] tuples rather than values.
18843 while (!(step = iterator.next()).done) {
18844 var entry = step.value;
18845 if (entry) {
18846 child = entry[1];
18847 nextName = nextNamePrefix + wrapUserProvidedKey(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0);
18848 subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
18849 }
18850 }
18851 }
18852 } else if (type === 'object') {
18853 var addendum = '';
18854 if ("development" !== 'production') {
18855 addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.';
18856 if (children._isReactElement) {
18857 addendum = ' It looks like you\'re using an element created by a different ' + 'version of React. Make sure to use only one copy of React.';
18858 }
18859 if (ReactCurrentOwner.current) {
18860 var name = ReactCurrentOwner.current.getName();
18861 if (name) {
18862 addendum += ' Check the render method of `' + name + '`.';
18863 }
18864 }
18865 }
18866 var childrenString = String(children);
18867 !false ? "development" !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : invariant(false) : undefined;
18868 }
18869 }
18870
18871 return subtreeCount;
18872}
18873
18874/**
18875 * Traverses children that are typically specified as `props.children`, but
18876 * might also be specified through attributes:
18877 *
18878 * - `traverseAllChildren(this.props.children, ...)`
18879 * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
18880 *
18881 * The `traverseContext` is an optional argument that is passed through the
18882 * entire traversal. It can be used to store accumulations or anything else that
18883 * the callback might find relevant.
18884 *
18885 * @param {?*} children Children tree object.
18886 * @param {!function} callback To invoke upon traversing each child.
18887 * @param {?*} traverseContext Context for traversal.
18888 * @return {!number} The number of children in this subtree.
18889 */
18890function traverseAllChildren(children, callback, traverseContext) {
18891 if (children == null) {
18892 return 0;
18893 }
18894
18895 return traverseAllChildrenImpl(children, '', callback, traverseContext);
18896}
18897
18898module.exports = traverseAllChildren;
18899},{"129":129,"161":161,"173":173,"39":39,"57":57,"67":67}],143:[function(_dereq_,module,exports){
18900/**
18901 * Copyright 2013-2015, Facebook, Inc.
18902 * All rights reserved.
18903 *
18904 * This source code is licensed under the BSD-style license found in the
18905 * LICENSE file in the root directory of this source tree. An additional grant
18906 * of patent rights can be found in the PATENTS file in the same directory.
18907 *
18908 * @providesModule update
18909 */
18910
18911/* global hasOwnProperty:true */
18912
18913'use strict';
18914
18915var assign = _dereq_(24);
18916var keyOf = _dereq_(166);
18917var invariant = _dereq_(161);
18918var hasOwnProperty = ({}).hasOwnProperty;
18919
18920function shallowCopy(x) {
18921 if (Array.isArray(x)) {
18922 return x.concat();
18923 } else if (x && typeof x === 'object') {
18924 return assign(new x.constructor(), x);
18925 } else {
18926 return x;
18927 }
18928}
18929
18930var COMMAND_PUSH = keyOf({ $push: null });
18931var COMMAND_UNSHIFT = keyOf({ $unshift: null });
18932var COMMAND_SPLICE = keyOf({ $splice: null });
18933var COMMAND_SET = keyOf({ $set: null });
18934var COMMAND_MERGE = keyOf({ $merge: null });
18935var COMMAND_APPLY = keyOf({ $apply: null });
18936
18937var ALL_COMMANDS_LIST = [COMMAND_PUSH, COMMAND_UNSHIFT, COMMAND_SPLICE, COMMAND_SET, COMMAND_MERGE, COMMAND_APPLY];
18938
18939var ALL_COMMANDS_SET = {};
18940
18941ALL_COMMANDS_LIST.forEach(function (command) {
18942 ALL_COMMANDS_SET[command] = true;
18943});
18944
18945function invariantArrayCase(value, spec, command) {
18946 !Array.isArray(value) ? "development" !== 'production' ? invariant(false, 'update(): expected target of %s to be an array; got %s.', command, value) : invariant(false) : undefined;
18947 var specValue = spec[command];
18948 !Array.isArray(specValue) ? "development" !== 'production' ? invariant(false, 'update(): expected spec of %s to be an array; got %s. ' + 'Did you forget to wrap your parameter in an array?', command, specValue) : invariant(false) : undefined;
18949}
18950
18951function update(value, spec) {
18952 !(typeof spec === 'object') ? "development" !== 'production' ? invariant(false, 'update(): You provided a key path to update() that did not contain one ' + 'of %s. Did you forget to include {%s: ...}?', ALL_COMMANDS_LIST.join(', '), COMMAND_SET) : invariant(false) : undefined;
18953
18954 if (hasOwnProperty.call(spec, COMMAND_SET)) {
18955 !(Object.keys(spec).length === 1) ? "development" !== 'production' ? invariant(false, 'Cannot have more than one key in an object with %s', COMMAND_SET) : invariant(false) : undefined;
18956
18957 return spec[COMMAND_SET];
18958 }
18959
18960 var nextValue = shallowCopy(value);
18961
18962 if (hasOwnProperty.call(spec, COMMAND_MERGE)) {
18963 var mergeObj = spec[COMMAND_MERGE];
18964 !(mergeObj && typeof mergeObj === 'object') ? "development" !== 'production' ? invariant(false, 'update(): %s expects a spec of type \'object\'; got %s', COMMAND_MERGE, mergeObj) : invariant(false) : undefined;
18965 !(nextValue && typeof nextValue === 'object') ? "development" !== 'production' ? invariant(false, 'update(): %s expects a target of type \'object\'; got %s', COMMAND_MERGE, nextValue) : invariant(false) : undefined;
18966 assign(nextValue, spec[COMMAND_MERGE]);
18967 }
18968
18969 if (hasOwnProperty.call(spec, COMMAND_PUSH)) {
18970 invariantArrayCase(value, spec, COMMAND_PUSH);
18971 spec[COMMAND_PUSH].forEach(function (item) {
18972 nextValue.push(item);
18973 });
18974 }
18975
18976 if (hasOwnProperty.call(spec, COMMAND_UNSHIFT)) {
18977 invariantArrayCase(value, spec, COMMAND_UNSHIFT);
18978 spec[COMMAND_UNSHIFT].forEach(function (item) {
18979 nextValue.unshift(item);
18980 });
18981 }
18982
18983 if (hasOwnProperty.call(spec, COMMAND_SPLICE)) {
18984 !Array.isArray(value) ? "development" !== 'production' ? invariant(false, 'Expected %s target to be an array; got %s', COMMAND_SPLICE, value) : invariant(false) : undefined;
18985 !Array.isArray(spec[COMMAND_SPLICE]) ? "development" !== 'production' ? invariant(false, 'update(): expected spec of %s to be an array of arrays; got %s. ' + 'Did you forget to wrap your parameters in an array?', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : invariant(false) : undefined;
18986 spec[COMMAND_SPLICE].forEach(function (args) {
18987 !Array.isArray(args) ? "development" !== 'production' ? invariant(false, 'update(): expected spec of %s to be an array of arrays; got %s. ' + 'Did you forget to wrap your parameters in an array?', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : invariant(false) : undefined;
18988 nextValue.splice.apply(nextValue, args);
18989 });
18990 }
18991
18992 if (hasOwnProperty.call(spec, COMMAND_APPLY)) {
18993 !(typeof spec[COMMAND_APPLY] === 'function') ? "development" !== 'production' ? invariant(false, 'update(): expected spec of %s to be a function; got %s.', COMMAND_APPLY, spec[COMMAND_APPLY]) : invariant(false) : undefined;
18994 nextValue = spec[COMMAND_APPLY](nextValue);
18995 }
18996
18997 for (var k in spec) {
18998 if (!(ALL_COMMANDS_SET.hasOwnProperty(k) && ALL_COMMANDS_SET[k])) {
18999 nextValue[k] = update(value[k], spec[k]);
19000 }
19001 }
19002
19003 return nextValue;
19004}
19005
19006module.exports = update;
19007},{"161":161,"166":166,"24":24}],144:[function(_dereq_,module,exports){
19008/**
19009 * Copyright 2015, Facebook, Inc.
19010 * All rights reserved.
19011 *
19012 * This source code is licensed under the BSD-style license found in the
19013 * LICENSE file in the root directory of this source tree. An additional grant
19014 * of patent rights can be found in the PATENTS file in the same directory.
19015 *
19016 * @providesModule validateDOMNesting
19017 */
19018
19019'use strict';
19020
19021var assign = _dereq_(24);
19022var emptyFunction = _dereq_(153);
19023var warning = _dereq_(173);
19024
19025var validateDOMNesting = emptyFunction;
19026
19027if ("development" !== 'production') {
19028 // This validation code was written based on the HTML5 parsing spec:
19029 // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
19030 //
19031 // Note: this does not catch all invalid nesting, nor does it try to (as it's
19032 // not clear what practical benefit doing so provides); instead, we warn only
19033 // for cases where the parser will give a parse tree differing from what React
19034 // intended. For example, <b><div></div></b> is invalid but we don't warn
19035 // because it still parses correctly; we do warn for other cases like nested
19036 // <p> tags where the beginning of the second element implicitly closes the
19037 // first, causing a confusing mess.
19038
19039 // https://html.spec.whatwg.org/multipage/syntax.html#special
19040 var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp'];
19041
19042 // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
19043 var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template',
19044
19045 // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point
19046 // TODO: Distinguish by namespace here -- for <title>, including it here
19047 // errs on the side of fewer warnings
19048 'foreignObject', 'desc', 'title'];
19049
19050 // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope
19051 var buttonScopeTags = inScopeTags.concat(['button']);
19052
19053 // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags
19054 var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];
19055
19056 var emptyAncestorInfo = {
19057 parentTag: null,
19058
19059 formTag: null,
19060 aTagInScope: null,
19061 buttonTagInScope: null,
19062 nobrTagInScope: null,
19063 pTagInButtonScope: null,
19064
19065 listItemTagAutoclosing: null,
19066 dlItemTagAutoclosing: null
19067 };
19068
19069 var updatedAncestorInfo = function (oldInfo, tag, instance) {
19070 var ancestorInfo = assign({}, oldInfo || emptyAncestorInfo);
19071 var info = { tag: tag, instance: instance };
19072
19073 if (inScopeTags.indexOf(tag) !== -1) {
19074 ancestorInfo.aTagInScope = null;
19075 ancestorInfo.buttonTagInScope = null;
19076 ancestorInfo.nobrTagInScope = null;
19077 }
19078 if (buttonScopeTags.indexOf(tag) !== -1) {
19079 ancestorInfo.pTagInButtonScope = null;
19080 }
19081
19082 // See rules for 'li', 'dd', 'dt' start tags in
19083 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
19084 if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {
19085 ancestorInfo.listItemTagAutoclosing = null;
19086 ancestorInfo.dlItemTagAutoclosing = null;
19087 }
19088
19089 ancestorInfo.parentTag = info;
19090
19091 if (tag === 'form') {
19092 ancestorInfo.formTag = info;
19093 }
19094 if (tag === 'a') {
19095 ancestorInfo.aTagInScope = info;
19096 }
19097 if (tag === 'button') {
19098 ancestorInfo.buttonTagInScope = info;
19099 }
19100 if (tag === 'nobr') {
19101 ancestorInfo.nobrTagInScope = info;
19102 }
19103 if (tag === 'p') {
19104 ancestorInfo.pTagInButtonScope = info;
19105 }
19106 if (tag === 'li') {
19107 ancestorInfo.listItemTagAutoclosing = info;
19108 }
19109 if (tag === 'dd' || tag === 'dt') {
19110 ancestorInfo.dlItemTagAutoclosing = info;
19111 }
19112
19113 return ancestorInfo;
19114 };
19115
19116 /**
19117 * Returns whether
19118 */
19119 var isTagValidWithParent = function (tag, parentTag) {
19120 // First, let's check if we're in an unusual parsing mode...
19121 switch (parentTag) {
19122 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect
19123 case 'select':
19124 return tag === 'option' || tag === 'optgroup' || tag === '#text';
19125 case 'optgroup':
19126 return tag === 'option' || tag === '#text';
19127 // Strictly speaking, seeing an <option> doesn't mean we're in a <select>
19128 // but
19129 case 'option':
19130 return tag === '#text';
19131
19132 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd
19133 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption
19134 // No special behavior since these rules fall back to "in body" mode for
19135 // all except special table nodes which cause bad parsing behavior anyway.
19136
19137 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr
19138 case 'tr':
19139 return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';
19140
19141 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody
19142 case 'tbody':
19143 case 'thead':
19144 case 'tfoot':
19145 return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';
19146
19147 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup
19148 case 'colgroup':
19149 return tag === 'col' || tag === 'template';
19150
19151 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable
19152 case 'table':
19153 return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';
19154
19155 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead
19156 case 'head':
19157 return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';
19158
19159 // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element
19160 case 'html':
19161 return tag === 'head' || tag === 'body';
19162 }
19163
19164 // Probably in the "in body" parsing mode, so we outlaw only tag combos
19165 // where the parsing rules cause implicit opens or closes to be added.
19166 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
19167 switch (tag) {
19168 case 'h1':
19169 case 'h2':
19170 case 'h3':
19171 case 'h4':
19172 case 'h5':
19173 case 'h6':
19174 return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';
19175
19176 case 'rp':
19177 case 'rt':
19178 return impliedEndTags.indexOf(parentTag) === -1;
19179
19180 case 'caption':
19181 case 'col':
19182 case 'colgroup':
19183 case 'frame':
19184 case 'head':
19185 case 'tbody':
19186 case 'td':
19187 case 'tfoot':
19188 case 'th':
19189 case 'thead':
19190 case 'tr':
19191 // These tags are only valid with a few parents that have special child
19192 // parsing rules -- if we're down here, then none of those matched and
19193 // so we allow it only if we don't know what the parent is, as all other
19194 // cases are invalid.
19195 return parentTag == null;
19196 }
19197
19198 return true;
19199 };
19200
19201 /**
19202 * Returns whether
19203 */
19204 var findInvalidAncestorForTag = function (tag, ancestorInfo) {
19205 switch (tag) {
19206 case 'address':
19207 case 'article':
19208 case 'aside':
19209 case 'blockquote':
19210 case 'center':
19211 case 'details':
19212 case 'dialog':
19213 case 'dir':
19214 case 'div':
19215 case 'dl':
19216 case 'fieldset':
19217 case 'figcaption':
19218 case 'figure':
19219 case 'footer':
19220 case 'header':
19221 case 'hgroup':
19222 case 'main':
19223 case 'menu':
19224 case 'nav':
19225 case 'ol':
19226 case 'p':
19227 case 'section':
19228 case 'summary':
19229 case 'ul':
19230
19231 case 'pre':
19232 case 'listing':
19233
19234 case 'table':
19235
19236 case 'hr':
19237
19238 case 'xmp':
19239
19240 case 'h1':
19241 case 'h2':
19242 case 'h3':
19243 case 'h4':
19244 case 'h5':
19245 case 'h6':
19246 return ancestorInfo.pTagInButtonScope;
19247
19248 case 'form':
19249 return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
19250
19251 case 'li':
19252 return ancestorInfo.listItemTagAutoclosing;
19253
19254 case 'dd':
19255 case 'dt':
19256 return ancestorInfo.dlItemTagAutoclosing;
19257
19258 case 'button':
19259 return ancestorInfo.buttonTagInScope;
19260
19261 case 'a':
19262 // Spec says something about storing a list of markers, but it sounds
19263 // equivalent to this check.
19264 return ancestorInfo.aTagInScope;
19265
19266 case 'nobr':
19267 return ancestorInfo.nobrTagInScope;
19268 }
19269
19270 return null;
19271 };
19272
19273 /**
19274 * Given a ReactCompositeComponent instance, return a list of its recursive
19275 * owners, starting at the root and ending with the instance itself.
19276 */
19277 var findOwnerStack = function (instance) {
19278 if (!instance) {
19279 return [];
19280 }
19281
19282 var stack = [];
19283 /*eslint-disable space-after-keywords */
19284 do {
19285 /*eslint-enable space-after-keywords */
19286 stack.push(instance);
19287 } while (instance = instance._currentElement._owner);
19288 stack.reverse();
19289 return stack;
19290 };
19291
19292 var didWarn = {};
19293
19294 validateDOMNesting = function (childTag, childInstance, ancestorInfo) {
19295 ancestorInfo = ancestorInfo || emptyAncestorInfo;
19296 var parentInfo = ancestorInfo.parentTag;
19297 var parentTag = parentInfo && parentInfo.tag;
19298
19299 var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
19300 var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
19301 var problematic = invalidParent || invalidAncestor;
19302
19303 if (problematic) {
19304 var ancestorTag = problematic.tag;
19305 var ancestorInstance = problematic.instance;
19306
19307 var childOwner = childInstance && childInstance._currentElement._owner;
19308 var ancestorOwner = ancestorInstance && ancestorInstance._currentElement._owner;
19309
19310 var childOwners = findOwnerStack(childOwner);
19311 var ancestorOwners = findOwnerStack(ancestorOwner);
19312
19313 var minStackLen = Math.min(childOwners.length, ancestorOwners.length);
19314 var i;
19315
19316 var deepestCommon = -1;
19317 for (i = 0; i < minStackLen; i++) {
19318 if (childOwners[i] === ancestorOwners[i]) {
19319 deepestCommon = i;
19320 } else {
19321 break;
19322 }
19323 }
19324
19325 var UNKNOWN = '(unknown)';
19326 var childOwnerNames = childOwners.slice(deepestCommon + 1).map(function (inst) {
19327 return inst.getName() || UNKNOWN;
19328 });
19329 var ancestorOwnerNames = ancestorOwners.slice(deepestCommon + 1).map(function (inst) {
19330 return inst.getName() || UNKNOWN;
19331 });
19332 var ownerInfo = [].concat(
19333 // If the parent and child instances have a common owner ancestor, start
19334 // with that -- otherwise we just start with the parent's owners.
19335 deepestCommon !== -1 ? childOwners[deepestCommon].getName() || UNKNOWN : [], ancestorOwnerNames, ancestorTag,
19336 // If we're warning about an invalid (non-parent) ancestry, add '...'
19337 invalidAncestor ? ['...'] : [], childOwnerNames, childTag).join(' > ');
19338
19339 var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + ownerInfo;
19340 if (didWarn[warnKey]) {
19341 return;
19342 }
19343 didWarn[warnKey] = true;
19344
19345 if (invalidParent) {
19346 var info = '';
19347 if (ancestorTag === 'table' && childTag === 'tr') {
19348 info += ' Add a <tbody> to your code to match the DOM tree generated by ' + 'the browser.';
19349 }
19350 "development" !== 'production' ? warning(false, 'validateDOMNesting(...): <%s> cannot appear as a child of <%s>. ' + 'See %s.%s', childTag, ancestorTag, ownerInfo, info) : undefined;
19351 } else {
19352 "development" !== 'production' ? warning(false, 'validateDOMNesting(...): <%s> cannot appear as a descendant of ' + '<%s>. See %s.', childTag, ancestorTag, ownerInfo) : undefined;
19353 }
19354 }
19355 };
19356
19357 validateDOMNesting.ancestorInfoContextKey = '__validateDOMNesting_ancestorInfo$' + Math.random().toString(36).slice(2);
19358
19359 validateDOMNesting.updatedAncestorInfo = updatedAncestorInfo;
19360
19361 // For testing
19362 validateDOMNesting.isTagValidInContext = function (tag, ancestorInfo) {
19363 ancestorInfo = ancestorInfo || emptyAncestorInfo;
19364 var parentInfo = ancestorInfo.parentTag;
19365 var parentTag = parentInfo && parentInfo.tag;
19366 return isTagValidWithParent(tag, parentTag) && !findInvalidAncestorForTag(tag, ancestorInfo);
19367 };
19368}
19369
19370module.exports = validateDOMNesting;
19371},{"153":153,"173":173,"24":24}],145:[function(_dereq_,module,exports){
19372/**
19373 * Copyright 2013-2015, Facebook, Inc.
19374 * All rights reserved.
19375 *
19376 * This source code is licensed under the BSD-style license found in the
19377 * LICENSE file in the root directory of this source tree. An additional grant
19378 * of patent rights can be found in the PATENTS file in the same directory.
19379 *
19380 * @providesModule CSSCore
19381 * @typechecks
19382 */
19383
19384'use strict';
19385
19386var invariant = _dereq_(161);
19387
19388/**
19389 * The CSSCore module specifies the API (and implements most of the methods)
19390 * that should be used when dealing with the display of elements (via their
19391 * CSS classes and visibility on screen. It is an API focused on mutating the
19392 * display and not reading it as no logical state should be encoded in the
19393 * display of elements.
19394 */
19395
19396var CSSCore = {
19397
19398 /**
19399 * Adds the class passed in to the element if it doesn't already have it.
19400 *
19401 * @param {DOMElement} element the element to set the class on
19402 * @param {string} className the CSS className
19403 * @return {DOMElement} the element passed in
19404 */
19405 addClass: function (element, className) {
19406 !!/\s/.test(className) ? "development" !== 'production' ? invariant(false, 'CSSCore.addClass takes only a single class name. "%s" contains ' + 'multiple classes.', className) : invariant(false) : undefined;
19407
19408 if (className) {
19409 if (element.classList) {
19410 element.classList.add(className);
19411 } else if (!CSSCore.hasClass(element, className)) {
19412 element.className = element.className + ' ' + className;
19413 }
19414 }
19415 return element;
19416 },
19417
19418 /**
19419 * Removes the class passed in from the element
19420 *
19421 * @param {DOMElement} element the element to set the class on
19422 * @param {string} className the CSS className
19423 * @return {DOMElement} the element passed in
19424 */
19425 removeClass: function (element, className) {
19426 !!/\s/.test(className) ? "development" !== 'production' ? invariant(false, 'CSSCore.removeClass takes only a single class name. "%s" contains ' + 'multiple classes.', className) : invariant(false) : undefined;
19427
19428 if (className) {
19429 if (element.classList) {
19430 element.classList.remove(className);
19431 } else if (CSSCore.hasClass(element, className)) {
19432 element.className = element.className.replace(new RegExp('(^|\\s)' + className + '(?:\\s|$)', 'g'), '$1').replace(/\s+/g, ' ') // multiple spaces to one
19433 .replace(/^\s*|\s*$/g, ''); // trim the ends
19434 }
19435 }
19436 return element;
19437 },
19438
19439 /**
19440 * Helper to add or remove a class from an element based on a condition.
19441 *
19442 * @param {DOMElement} element the element to set the class on
19443 * @param {string} className the CSS className
19444 * @param {*} bool condition to whether to add or remove the class
19445 * @return {DOMElement} the element passed in
19446 */
19447 conditionClass: function (element, className, bool) {
19448 return (bool ? CSSCore.addClass : CSSCore.removeClass)(element, className);
19449 },
19450
19451 /**
19452 * Tests whether the element has the class specified.
19453 *
19454 * @param {DOMNode|DOMWindow} element the element to set the class on
19455 * @param {string} className the CSS className
19456 * @return {boolean} true if the element has the class, false if not
19457 */
19458 hasClass: function (element, className) {
19459 !!/\s/.test(className) ? "development" !== 'production' ? invariant(false, 'CSS.hasClass takes only a single class name.') : invariant(false) : undefined;
19460 if (element.classList) {
19461 return !!className && element.classList.contains(className);
19462 }
19463 return (' ' + element.className + ' ').indexOf(' ' + className + ' ') > -1;
19464 }
19465
19466};
19467
19468module.exports = CSSCore;
19469},{"161":161}],146:[function(_dereq_,module,exports){
19470/**
19471 * Copyright 2013-2015, Facebook, Inc.
19472 *
19473 * Licensed under the Apache License, Version 2.0 (the "License");
19474 * you may not use this file except in compliance with the License.
19475 * You may obtain a copy of the License at
19476 *
19477 * http://www.apache.org/licenses/LICENSE-2.0
19478 *
19479 * Unless required by applicable law or agreed to in writing, software
19480 * distributed under the License is distributed on an "AS IS" BASIS,
19481 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19482 * See the License for the specific language governing permissions and
19483 * limitations under the License.
19484 *
19485 * @providesModule EventListener
19486 * @typechecks
19487 */
19488
19489'use strict';
19490
19491var emptyFunction = _dereq_(153);
19492
19493/**
19494 * Upstream version of event listener. Does not take into account specific
19495 * nature of platform.
19496 */
19497var EventListener = {
19498 /**
19499 * Listen to DOM events during the bubble phase.
19500 *
19501 * @param {DOMEventTarget} target DOM element to register listener on.
19502 * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
19503 * @param {function} callback Callback function.
19504 * @return {object} Object with a `remove` method.
19505 */
19506 listen: function (target, eventType, callback) {
19507 if (target.addEventListener) {
19508 target.addEventListener(eventType, callback, false);
19509 return {
19510 remove: function () {
19511 target.removeEventListener(eventType, callback, false);
19512 }
19513 };
19514 } else if (target.attachEvent) {
19515 target.attachEvent('on' + eventType, callback);
19516 return {
19517 remove: function () {
19518 target.detachEvent('on' + eventType, callback);
19519 }
19520 };
19521 }
19522 },
19523
19524 /**
19525 * Listen to DOM events during the capture phase.
19526 *
19527 * @param {DOMEventTarget} target DOM element to register listener on.
19528 * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
19529 * @param {function} callback Callback function.
19530 * @return {object} Object with a `remove` method.
19531 */
19532 capture: function (target, eventType, callback) {
19533 if (target.addEventListener) {
19534 target.addEventListener(eventType, callback, true);
19535 return {
19536 remove: function () {
19537 target.removeEventListener(eventType, callback, true);
19538 }
19539 };
19540 } else {
19541 if ("development" !== 'production') {
19542 console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.');
19543 }
19544 return {
19545 remove: emptyFunction
19546 };
19547 }
19548 },
19549
19550 registerDefault: function () {}
19551};
19552
19553module.exports = EventListener;
19554},{"153":153}],147:[function(_dereq_,module,exports){
19555/**
19556 * Copyright 2013-2015, Facebook, Inc.
19557 * All rights reserved.
19558 *
19559 * This source code is licensed under the BSD-style license found in the
19560 * LICENSE file in the root directory of this source tree. An additional grant
19561 * of patent rights can be found in the PATENTS file in the same directory.
19562 *
19563 * @providesModule ExecutionEnvironment
19564 */
19565
19566'use strict';
19567
19568var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
19569
19570/**
19571 * Simple, lightweight module assisting with the detection and context of
19572 * Worker. Helps avoid circular dependencies and allows code to reason about
19573 * whether or not they are in a Worker, even if they never include the main
19574 * `ReactWorker` dependency.
19575 */
19576var ExecutionEnvironment = {
19577
19578 canUseDOM: canUseDOM,
19579
19580 canUseWorkers: typeof Worker !== 'undefined',
19581
19582 canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
19583
19584 canUseViewport: canUseDOM && !!window.screen,
19585
19586 isInWorker: !canUseDOM // For now, this is true - might change in the future.
19587
19588};
19589
19590module.exports = ExecutionEnvironment;
19591},{}],148:[function(_dereq_,module,exports){
19592/**
19593 * Copyright 2013-2015, Facebook, Inc.
19594 * All rights reserved.
19595 *
19596 * This source code is licensed under the BSD-style license found in the
19597 * LICENSE file in the root directory of this source tree. An additional grant
19598 * of patent rights can be found in the PATENTS file in the same directory.
19599 *
19600 * @providesModule camelize
19601 * @typechecks
19602 */
19603
19604"use strict";
19605
19606var _hyphenPattern = /-(.)/g;
19607
19608/**
19609 * Camelcases a hyphenated string, for example:
19610 *
19611 * > camelize('background-color')
19612 * < "backgroundColor"
19613 *
19614 * @param {string} string
19615 * @return {string}
19616 */
19617function camelize(string) {
19618 return string.replace(_hyphenPattern, function (_, character) {
19619 return character.toUpperCase();
19620 });
19621}
19622
19623module.exports = camelize;
19624},{}],149:[function(_dereq_,module,exports){
19625/**
19626 * Copyright 2013-2015, Facebook, Inc.
19627 * All rights reserved.
19628 *
19629 * This source code is licensed under the BSD-style license found in the
19630 * LICENSE file in the root directory of this source tree. An additional grant
19631 * of patent rights can be found in the PATENTS file in the same directory.
19632 *
19633 * @providesModule camelizeStyleName
19634 * @typechecks
19635 */
19636
19637'use strict';
19638
19639var camelize = _dereq_(148);
19640
19641var msPattern = /^-ms-/;
19642
19643/**
19644 * Camelcases a hyphenated CSS property name, for example:
19645 *
19646 * > camelizeStyleName('background-color')
19647 * < "backgroundColor"
19648 * > camelizeStyleName('-moz-transition')
19649 * < "MozTransition"
19650 * > camelizeStyleName('-ms-transition')
19651 * < "msTransition"
19652 *
19653 * As Andi Smith suggests
19654 * (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
19655 * is converted to lowercase `ms`.
19656 *
19657 * @param {string} string
19658 * @return {string}
19659 */
19660function camelizeStyleName(string) {
19661 return camelize(string.replace(msPattern, 'ms-'));
19662}
19663
19664module.exports = camelizeStyleName;
19665},{"148":148}],150:[function(_dereq_,module,exports){
19666/**
19667 * Copyright 2013-2015, Facebook, Inc.
19668 * All rights reserved.
19669 *
19670 * This source code is licensed under the BSD-style license found in the
19671 * LICENSE file in the root directory of this source tree. An additional grant
19672 * of patent rights can be found in the PATENTS file in the same directory.
19673 *
19674 * @providesModule containsNode
19675 * @typechecks
19676 */
19677
19678'use strict';
19679
19680var isTextNode = _dereq_(163);
19681
19682/*eslint-disable no-bitwise */
19683
19684/**
19685 * Checks if a given DOM node contains or is another DOM node.
19686 *
19687 * @param {?DOMNode} outerNode Outer DOM node.
19688 * @param {?DOMNode} innerNode Inner DOM node.
19689 * @return {boolean} True if `outerNode` contains or is `innerNode`.
19690 */
19691function containsNode(_x, _x2) {
19692 var _again = true;
19693
19694 _function: while (_again) {
19695 var outerNode = _x,
19696 innerNode = _x2;
19697 _again = false;
19698
19699 if (!outerNode || !innerNode) {
19700 return false;
19701 } else if (outerNode === innerNode) {
19702 return true;
19703 } else if (isTextNode(outerNode)) {
19704 return false;
19705 } else if (isTextNode(innerNode)) {
19706 _x = outerNode;
19707 _x2 = innerNode.parentNode;
19708 _again = true;
19709 continue _function;
19710 } else if (outerNode.contains) {
19711 return outerNode.contains(innerNode);
19712 } else if (outerNode.compareDocumentPosition) {
19713 return !!(outerNode.compareDocumentPosition(innerNode) & 16);
19714 } else {
19715 return false;
19716 }
19717 }
19718}
19719
19720module.exports = containsNode;
19721},{"163":163}],151:[function(_dereq_,module,exports){
19722/**
19723 * Copyright 2013-2015, Facebook, Inc.
19724 * All rights reserved.
19725 *
19726 * This source code is licensed under the BSD-style license found in the
19727 * LICENSE file in the root directory of this source tree. An additional grant
19728 * of patent rights can be found in the PATENTS file in the same directory.
19729 *
19730 * @providesModule createArrayFromMixed
19731 * @typechecks
19732 */
19733
19734'use strict';
19735
19736var toArray = _dereq_(172);
19737
19738/**
19739 * Perform a heuristic test to determine if an object is "array-like".
19740 *
19741 * A monk asked Joshu, a Zen master, "Has a dog Buddha nature?"
19742 * Joshu replied: "Mu."
19743 *
19744 * This function determines if its argument has "array nature": it returns
19745 * true if the argument is an actual array, an `arguments' object, or an
19746 * HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()).
19747 *
19748 * It will return false for other array-like objects like Filelist.
19749 *
19750 * @param {*} obj
19751 * @return {boolean}
19752 */
19753function hasArrayNature(obj) {
19754 return(
19755 // not null/false
19756 !!obj && (
19757 // arrays are objects, NodeLists are functions in Safari
19758 typeof obj == 'object' || typeof obj == 'function') &&
19759 // quacks like an array
19760 'length' in obj &&
19761 // not window
19762 !('setInterval' in obj) &&
19763 // no DOM node should be considered an array-like
19764 // a 'select' element has 'length' and 'item' properties on IE8
19765 typeof obj.nodeType != 'number' && (
19766 // a real array
19767 Array.isArray(obj) ||
19768 // arguments
19769 'callee' in obj ||
19770 // HTMLCollection/NodeList
19771 'item' in obj)
19772 );
19773}
19774
19775/**
19776 * Ensure that the argument is an array by wrapping it in an array if it is not.
19777 * Creates a copy of the argument if it is already an array.
19778 *
19779 * This is mostly useful idiomatically:
19780 *
19781 * var createArrayFromMixed = require('createArrayFromMixed');
19782 *
19783 * function takesOneOrMoreThings(things) {
19784 * things = createArrayFromMixed(things);
19785 * ...
19786 * }
19787 *
19788 * This allows you to treat `things' as an array, but accept scalars in the API.
19789 *
19790 * If you need to convert an array-like object, like `arguments`, into an array
19791 * use toArray instead.
19792 *
19793 * @param {*} obj
19794 * @return {array}
19795 */
19796function createArrayFromMixed(obj) {
19797 if (!hasArrayNature(obj)) {
19798 return [obj];
19799 } else if (Array.isArray(obj)) {
19800 return obj.slice();
19801 } else {
19802 return toArray(obj);
19803 }
19804}
19805
19806module.exports = createArrayFromMixed;
19807},{"172":172}],152:[function(_dereq_,module,exports){
19808/**
19809 * Copyright 2013-2015, Facebook, Inc.
19810 * All rights reserved.
19811 *
19812 * This source code is licensed under the BSD-style license found in the
19813 * LICENSE file in the root directory of this source tree. An additional grant
19814 * of patent rights can be found in the PATENTS file in the same directory.
19815 *
19816 * @providesModule createNodesFromMarkup
19817 * @typechecks
19818 */
19819
19820/*eslint-disable fb-www/unsafe-html*/
19821
19822'use strict';
19823
19824var ExecutionEnvironment = _dereq_(147);
19825
19826var createArrayFromMixed = _dereq_(151);
19827var getMarkupWrap = _dereq_(157);
19828var invariant = _dereq_(161);
19829
19830/**
19831 * Dummy container used to render all markup.
19832 */
19833var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
19834
19835/**
19836 * Pattern used by `getNodeName`.
19837 */
19838var nodeNamePattern = /^\s*<(\w+)/;
19839
19840/**
19841 * Extracts the `nodeName` of the first element in a string of markup.
19842 *
19843 * @param {string} markup String of markup.
19844 * @return {?string} Node name of the supplied markup.
19845 */
19846function getNodeName(markup) {
19847 var nodeNameMatch = markup.match(nodeNamePattern);
19848 return nodeNameMatch && nodeNameMatch[1].toLowerCase();
19849}
19850
19851/**
19852 * Creates an array containing the nodes rendered from the supplied markup. The
19853 * optionally supplied `handleScript` function will be invoked once for each
19854 * <script> element that is rendered. If no `handleScript` function is supplied,
19855 * an exception is thrown if any <script> elements are rendered.
19856 *
19857 * @param {string} markup A string of valid HTML markup.
19858 * @param {?function} handleScript Invoked once for each rendered <script>.
19859 * @return {array<DOMElement|DOMTextNode>} An array of rendered nodes.
19860 */
19861function createNodesFromMarkup(markup, handleScript) {
19862 var node = dummyNode;
19863 !!!dummyNode ? "development" !== 'production' ? invariant(false, 'createNodesFromMarkup dummy not initialized') : invariant(false) : undefined;
19864 var nodeName = getNodeName(markup);
19865
19866 var wrap = nodeName && getMarkupWrap(nodeName);
19867 if (wrap) {
19868 node.innerHTML = wrap[1] + markup + wrap[2];
19869
19870 var wrapDepth = wrap[0];
19871 while (wrapDepth--) {
19872 node = node.lastChild;
19873 }
19874 } else {
19875 node.innerHTML = markup;
19876 }
19877
19878 var scripts = node.getElementsByTagName('script');
19879 if (scripts.length) {
19880 !handleScript ? "development" !== 'production' ? invariant(false, 'createNodesFromMarkup(...): Unexpected <script> element rendered.') : invariant(false) : undefined;
19881 createArrayFromMixed(scripts).forEach(handleScript);
19882 }
19883
19884 var nodes = createArrayFromMixed(node.childNodes);
19885 while (node.lastChild) {
19886 node.removeChild(node.lastChild);
19887 }
19888 return nodes;
19889}
19890
19891module.exports = createNodesFromMarkup;
19892},{"147":147,"151":151,"157":157,"161":161}],153:[function(_dereq_,module,exports){
19893/**
19894 * Copyright 2013-2015, Facebook, Inc.
19895 * All rights reserved.
19896 *
19897 * This source code is licensed under the BSD-style license found in the
19898 * LICENSE file in the root directory of this source tree. An additional grant
19899 * of patent rights can be found in the PATENTS file in the same directory.
19900 *
19901 * @providesModule emptyFunction
19902 */
19903
19904"use strict";
19905
19906function makeEmptyFunction(arg) {
19907 return function () {
19908 return arg;
19909 };
19910}
19911
19912/**
19913 * This function accepts and discards inputs; it has no side effects. This is
19914 * primarily useful idiomatically for overridable function endpoints which
19915 * always need to be callable, since JS lacks a null-call idiom ala Cocoa.
19916 */
19917function emptyFunction() {}
19918
19919emptyFunction.thatReturns = makeEmptyFunction;
19920emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
19921emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
19922emptyFunction.thatReturnsNull = makeEmptyFunction(null);
19923emptyFunction.thatReturnsThis = function () {
19924 return this;
19925};
19926emptyFunction.thatReturnsArgument = function (arg) {
19927 return arg;
19928};
19929
19930module.exports = emptyFunction;
19931},{}],154:[function(_dereq_,module,exports){
19932/**
19933 * Copyright 2013-2015, Facebook, Inc.
19934 * All rights reserved.
19935 *
19936 * This source code is licensed under the BSD-style license found in the
19937 * LICENSE file in the root directory of this source tree. An additional grant
19938 * of patent rights can be found in the PATENTS file in the same directory.
19939 *
19940 * @providesModule emptyObject
19941 */
19942
19943'use strict';
19944
19945var emptyObject = {};
19946
19947if ("development" !== 'production') {
19948 Object.freeze(emptyObject);
19949}
19950
19951module.exports = emptyObject;
19952},{}],155:[function(_dereq_,module,exports){
19953/**
19954 * Copyright 2013-2015, Facebook, Inc.
19955 * All rights reserved.
19956 *
19957 * This source code is licensed under the BSD-style license found in the
19958 * LICENSE file in the root directory of this source tree. An additional grant
19959 * of patent rights can be found in the PATENTS file in the same directory.
19960 *
19961 * @providesModule focusNode
19962 */
19963
19964'use strict';
19965
19966/**
19967 * @param {DOMElement} node input/textarea to focus
19968 */
19969function focusNode(node) {
19970 // IE8 can throw "Can't move focus to the control because it is invisible,
19971 // not enabled, or of a type that does not accept the focus." for all kinds of
19972 // reasons that are too expensive and fragile to test.
19973 try {
19974 node.focus();
19975 } catch (e) {}
19976}
19977
19978module.exports = focusNode;
19979},{}],156:[function(_dereq_,module,exports){
19980/**
19981 * Copyright 2013-2015, Facebook, Inc.
19982 * All rights reserved.
19983 *
19984 * This source code is licensed under the BSD-style license found in the
19985 * LICENSE file in the root directory of this source tree. An additional grant
19986 * of patent rights can be found in the PATENTS file in the same directory.
19987 *
19988 * @providesModule getActiveElement
19989 * @typechecks
19990 */
19991
19992/**
19993 * Same as document.activeElement but wraps in a try-catch block. In IE it is
19994 * not safe to call document.activeElement if there is nothing focused.
19995 *
19996 * The activeElement will be null only if the document or document body is not yet defined.
19997 */
19998'use strict';
19999
20000function getActiveElement() /*?DOMElement*/{
20001 if (typeof document === 'undefined') {
20002 return null;
20003 }
20004
20005 try {
20006 return document.activeElement || document.body;
20007 } catch (e) {
20008 return document.body;
20009 }
20010}
20011
20012module.exports = getActiveElement;
20013},{}],157:[function(_dereq_,module,exports){
20014/**
20015 * Copyright 2013-2015, Facebook, Inc.
20016 * All rights reserved.
20017 *
20018 * This source code is licensed under the BSD-style license found in the
20019 * LICENSE file in the root directory of this source tree. An additional grant
20020 * of patent rights can be found in the PATENTS file in the same directory.
20021 *
20022 * @providesModule getMarkupWrap
20023 */
20024
20025/*eslint-disable fb-www/unsafe-html */
20026
20027'use strict';
20028
20029var ExecutionEnvironment = _dereq_(147);
20030
20031var invariant = _dereq_(161);
20032
20033/**
20034 * Dummy container used to detect which wraps are necessary.
20035 */
20036var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
20037
20038/**
20039 * Some browsers cannot use `innerHTML` to render certain elements standalone,
20040 * so we wrap them, render the wrapped nodes, then extract the desired node.
20041 *
20042 * In IE8, certain elements cannot render alone, so wrap all elements ('*').
20043 */
20044
20045var shouldWrap = {};
20046
20047var selectWrap = [1, '<select multiple="true">', '</select>'];
20048var tableWrap = [1, '<table>', '</table>'];
20049var trWrap = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
20050
20051var svgWrap = [1, '<svg xmlns="http://www.w3.org/2000/svg">', '</svg>'];
20052
20053var markupWrap = {
20054 '*': [1, '?<div>', '</div>'],
20055
20056 'area': [1, '<map>', '</map>'],
20057 'col': [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
20058 'legend': [1, '<fieldset>', '</fieldset>'],
20059 'param': [1, '<object>', '</object>'],
20060 'tr': [2, '<table><tbody>', '</tbody></table>'],
20061
20062 'optgroup': selectWrap,
20063 'option': selectWrap,
20064
20065 'caption': tableWrap,
20066 'colgroup': tableWrap,
20067 'tbody': tableWrap,
20068 'tfoot': tableWrap,
20069 'thead': tableWrap,
20070
20071 'td': trWrap,
20072 'th': trWrap
20073};
20074
20075// Initialize the SVG elements since we know they'll always need to be wrapped
20076// consistently. If they are created inside a <div> they will be initialized in
20077// the wrong namespace (and will not display).
20078var svgElements = ['circle', 'clipPath', 'defs', 'ellipse', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'text', 'tspan'];
20079svgElements.forEach(function (nodeName) {
20080 markupWrap[nodeName] = svgWrap;
20081 shouldWrap[nodeName] = true;
20082});
20083
20084/**
20085 * Gets the markup wrap configuration for the supplied `nodeName`.
20086 *
20087 * NOTE: This lazily detects which wraps are necessary for the current browser.
20088 *
20089 * @param {string} nodeName Lowercase `nodeName`.
20090 * @return {?array} Markup wrap configuration, if applicable.
20091 */
20092function getMarkupWrap(nodeName) {
20093 !!!dummyNode ? "development" !== 'production' ? invariant(false, 'Markup wrapping node not initialized') : invariant(false) : undefined;
20094 if (!markupWrap.hasOwnProperty(nodeName)) {
20095 nodeName = '*';
20096 }
20097 if (!shouldWrap.hasOwnProperty(nodeName)) {
20098 if (nodeName === '*') {
20099 dummyNode.innerHTML = '<link />';
20100 } else {
20101 dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>';
20102 }
20103 shouldWrap[nodeName] = !dummyNode.firstChild;
20104 }
20105 return shouldWrap[nodeName] ? markupWrap[nodeName] : null;
20106}
20107
20108module.exports = getMarkupWrap;
20109},{"147":147,"161":161}],158:[function(_dereq_,module,exports){
20110/**
20111 * Copyright 2013-2015, Facebook, Inc.
20112 * All rights reserved.
20113 *
20114 * This source code is licensed under the BSD-style license found in the
20115 * LICENSE file in the root directory of this source tree. An additional grant
20116 * of patent rights can be found in the PATENTS file in the same directory.
20117 *
20118 * @providesModule getUnboundedScrollPosition
20119 * @typechecks
20120 */
20121
20122'use strict';
20123
20124/**
20125 * Gets the scroll position of the supplied element or window.
20126 *
20127 * The return values are unbounded, unlike `getScrollPosition`. This means they
20128 * may be negative or exceed the element boundaries (which is possible using
20129 * inertial scrolling).
20130 *
20131 * @param {DOMWindow|DOMElement} scrollable
20132 * @return {object} Map with `x` and `y` keys.
20133 */
20134function getUnboundedScrollPosition(scrollable) {
20135 if (scrollable === window) {
20136 return {
20137 x: window.pageXOffset || document.documentElement.scrollLeft,
20138 y: window.pageYOffset || document.documentElement.scrollTop
20139 };
20140 }
20141 return {
20142 x: scrollable.scrollLeft,
20143 y: scrollable.scrollTop
20144 };
20145}
20146
20147module.exports = getUnboundedScrollPosition;
20148},{}],159:[function(_dereq_,module,exports){
20149/**
20150 * Copyright 2013-2015, Facebook, Inc.
20151 * All rights reserved.
20152 *
20153 * This source code is licensed under the BSD-style license found in the
20154 * LICENSE file in the root directory of this source tree. An additional grant
20155 * of patent rights can be found in the PATENTS file in the same directory.
20156 *
20157 * @providesModule hyphenate
20158 * @typechecks
20159 */
20160
20161'use strict';
20162
20163var _uppercasePattern = /([A-Z])/g;
20164
20165/**
20166 * Hyphenates a camelcased string, for example:
20167 *
20168 * > hyphenate('backgroundColor')
20169 * < "background-color"
20170 *
20171 * For CSS style names, use `hyphenateStyleName` instead which works properly
20172 * with all vendor prefixes, including `ms`.
20173 *
20174 * @param {string} string
20175 * @return {string}
20176 */
20177function hyphenate(string) {
20178 return string.replace(_uppercasePattern, '-$1').toLowerCase();
20179}
20180
20181module.exports = hyphenate;
20182},{}],160:[function(_dereq_,module,exports){
20183/**
20184 * Copyright 2013-2015, Facebook, Inc.
20185 * All rights reserved.
20186 *
20187 * This source code is licensed under the BSD-style license found in the
20188 * LICENSE file in the root directory of this source tree. An additional grant
20189 * of patent rights can be found in the PATENTS file in the same directory.
20190 *
20191 * @providesModule hyphenateStyleName
20192 * @typechecks
20193 */
20194
20195'use strict';
20196
20197var hyphenate = _dereq_(159);
20198
20199var msPattern = /^ms-/;
20200
20201/**
20202 * Hyphenates a camelcased CSS property name, for example:
20203 *
20204 * > hyphenateStyleName('backgroundColor')
20205 * < "background-color"
20206 * > hyphenateStyleName('MozTransition')
20207 * < "-moz-transition"
20208 * > hyphenateStyleName('msTransition')
20209 * < "-ms-transition"
20210 *
20211 * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
20212 * is converted to `-ms-`.
20213 *
20214 * @param {string} string
20215 * @return {string}
20216 */
20217function hyphenateStyleName(string) {
20218 return hyphenate(string).replace(msPattern, '-ms-');
20219}
20220
20221module.exports = hyphenateStyleName;
20222},{"159":159}],161:[function(_dereq_,module,exports){
20223/**
20224 * Copyright 2013-2015, Facebook, Inc.
20225 * All rights reserved.
20226 *
20227 * This source code is licensed under the BSD-style license found in the
20228 * LICENSE file in the root directory of this source tree. An additional grant
20229 * of patent rights can be found in the PATENTS file in the same directory.
20230 *
20231 * @providesModule invariant
20232 */
20233
20234'use strict';
20235
20236/**
20237 * Use invariant() to assert state which your program assumes to be true.
20238 *
20239 * Provide sprintf-style format (only %s is supported) and arguments
20240 * to provide information about what broke and what you were
20241 * expecting.
20242 *
20243 * The invariant message will be stripped in production, but the invariant
20244 * will remain to ensure logic does not differ in production.
20245 */
20246
20247var invariant = function (condition, format, a, b, c, d, e, f) {
20248 if ("development" !== 'production') {
20249 if (format === undefined) {
20250 throw new Error('invariant requires an error message argument');
20251 }
20252 }
20253
20254 if (!condition) {
20255 var error;
20256 if (format === undefined) {
20257 error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
20258 } else {
20259 var args = [a, b, c, d, e, f];
20260 var argIndex = 0;
20261 error = new Error('Invariant Violation: ' + format.replace(/%s/g, function () {
20262 return args[argIndex++];
20263 }));
20264 }
20265
20266 error.framesToPop = 1; // we don't care about invariant's own frame
20267 throw error;
20268 }
20269};
20270
20271module.exports = invariant;
20272},{}],162:[function(_dereq_,module,exports){
20273/**
20274 * Copyright 2013-2015, Facebook, Inc.
20275 * All rights reserved.
20276 *
20277 * This source code is licensed under the BSD-style license found in the
20278 * LICENSE file in the root directory of this source tree. An additional grant
20279 * of patent rights can be found in the PATENTS file in the same directory.
20280 *
20281 * @providesModule isNode
20282 * @typechecks
20283 */
20284
20285/**
20286 * @param {*} object The object to check.
20287 * @return {boolean} Whether or not the object is a DOM node.
20288 */
20289'use strict';
20290
20291function isNode(object) {
20292 return !!(object && (typeof Node === 'function' ? object instanceof Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));
20293}
20294
20295module.exports = isNode;
20296},{}],163:[function(_dereq_,module,exports){
20297/**
20298 * Copyright 2013-2015, Facebook, Inc.
20299 * All rights reserved.
20300 *
20301 * This source code is licensed under the BSD-style license found in the
20302 * LICENSE file in the root directory of this source tree. An additional grant
20303 * of patent rights can be found in the PATENTS file in the same directory.
20304 *
20305 * @providesModule isTextNode
20306 * @typechecks
20307 */
20308
20309'use strict';
20310
20311var isNode = _dereq_(162);
20312
20313/**
20314 * @param {*} object The object to check.
20315 * @return {boolean} Whether or not the object is a DOM text node.
20316 */
20317function isTextNode(object) {
20318 return isNode(object) && object.nodeType == 3;
20319}
20320
20321module.exports = isTextNode;
20322},{"162":162}],164:[function(_dereq_,module,exports){
20323/**
20324 * Copyright 2013-2015, Facebook, Inc.
20325 * All rights reserved.
20326 *
20327 * This source code is licensed under the BSD-style license found in the
20328 * LICENSE file in the root directory of this source tree. An additional grant
20329 * of patent rights can be found in the PATENTS file in the same directory.
20330 *
20331 * @providesModule joinClasses
20332 * @typechecks static-only
20333 */
20334
20335'use strict';
20336
20337/**
20338 * Combines multiple className strings into one.
20339 * http://jsperf.com/joinclasses-args-vs-array
20340 *
20341 * @param {...?string} className
20342 * @return {string}
20343 */
20344function joinClasses(className /*, ... */) {
20345 if (!className) {
20346 className = '';
20347 }
20348 var nextClass;
20349 var argLength = arguments.length;
20350 if (argLength > 1) {
20351 for (var ii = 1; ii < argLength; ii++) {
20352 nextClass = arguments[ii];
20353 if (nextClass) {
20354 className = (className ? className + ' ' : '') + nextClass;
20355 }
20356 }
20357 }
20358 return className;
20359}
20360
20361module.exports = joinClasses;
20362},{}],165:[function(_dereq_,module,exports){
20363/**
20364 * Copyright 2013-2015, Facebook, Inc.
20365 * All rights reserved.
20366 *
20367 * This source code is licensed under the BSD-style license found in the
20368 * LICENSE file in the root directory of this source tree. An additional grant
20369 * of patent rights can be found in the PATENTS file in the same directory.
20370 *
20371 * @providesModule keyMirror
20372 * @typechecks static-only
20373 */
20374
20375'use strict';
20376
20377var invariant = _dereq_(161);
20378
20379/**
20380 * Constructs an enumeration with keys equal to their value.
20381 *
20382 * For example:
20383 *
20384 * var COLORS = keyMirror({blue: null, red: null});
20385 * var myColor = COLORS.blue;
20386 * var isColorValid = !!COLORS[myColor];
20387 *
20388 * The last line could not be performed if the values of the generated enum were
20389 * not equal to their keys.
20390 *
20391 * Input: {key1: val1, key2: val2}
20392 * Output: {key1: key1, key2: key2}
20393 *
20394 * @param {object} obj
20395 * @return {object}
20396 */
20397var keyMirror = function (obj) {
20398 var ret = {};
20399 var key;
20400 !(obj instanceof Object && !Array.isArray(obj)) ? "development" !== 'production' ? invariant(false, 'keyMirror(...): Argument must be an object.') : invariant(false) : undefined;
20401 for (key in obj) {
20402 if (!obj.hasOwnProperty(key)) {
20403 continue;
20404 }
20405 ret[key] = key;
20406 }
20407 return ret;
20408};
20409
20410module.exports = keyMirror;
20411},{"161":161}],166:[function(_dereq_,module,exports){
20412/**
20413 * Copyright 2013-2015, Facebook, Inc.
20414 * All rights reserved.
20415 *
20416 * This source code is licensed under the BSD-style license found in the
20417 * LICENSE file in the root directory of this source tree. An additional grant
20418 * of patent rights can be found in the PATENTS file in the same directory.
20419 *
20420 * @providesModule keyOf
20421 */
20422
20423/**
20424 * Allows extraction of a minified key. Let's the build system minify keys
20425 * without losing the ability to dynamically use key strings as values
20426 * themselves. Pass in an object with a single key/val pair and it will return
20427 * you the string key of that single record. Suppose you want to grab the
20428 * value for a key 'className' inside of an object. Key/val minification may
20429 * have aliased that key to be 'xa12'. keyOf({className: null}) will return
20430 * 'xa12' in that case. Resolve keys you want to use once at startup time, then
20431 * reuse those resolutions.
20432 */
20433"use strict";
20434
20435var keyOf = function (oneKeyObj) {
20436 var key;
20437 for (key in oneKeyObj) {
20438 if (!oneKeyObj.hasOwnProperty(key)) {
20439 continue;
20440 }
20441 return key;
20442 }
20443 return null;
20444};
20445
20446module.exports = keyOf;
20447},{}],167:[function(_dereq_,module,exports){
20448/**
20449 * Copyright 2013-2015, Facebook, Inc.
20450 * All rights reserved.
20451 *
20452 * This source code is licensed under the BSD-style license found in the
20453 * LICENSE file in the root directory of this source tree. An additional grant
20454 * of patent rights can be found in the PATENTS file in the same directory.
20455 *
20456 * @providesModule mapObject
20457 */
20458
20459'use strict';
20460
20461var hasOwnProperty = Object.prototype.hasOwnProperty;
20462
20463/**
20464 * Executes the provided `callback` once for each enumerable own property in the
20465 * object and constructs a new object from the results. The `callback` is
20466 * invoked with three arguments:
20467 *
20468 * - the property value
20469 * - the property name
20470 * - the object being traversed
20471 *
20472 * Properties that are added after the call to `mapObject` will not be visited
20473 * by `callback`. If the values of existing properties are changed, the value
20474 * passed to `callback` will be the value at the time `mapObject` visits them.
20475 * Properties that are deleted before being visited are not visited.
20476 *
20477 * @grep function objectMap()
20478 * @grep function objMap()
20479 *
20480 * @param {?object} object
20481 * @param {function} callback
20482 * @param {*} context
20483 * @return {?object}
20484 */
20485function mapObject(object, callback, context) {
20486 if (!object) {
20487 return null;
20488 }
20489 var result = {};
20490 for (var name in object) {
20491 if (hasOwnProperty.call(object, name)) {
20492 result[name] = callback.call(context, object[name], name, object);
20493 }
20494 }
20495 return result;
20496}
20497
20498module.exports = mapObject;
20499},{}],168:[function(_dereq_,module,exports){
20500/**
20501 * Copyright 2013-2015, Facebook, Inc.
20502 * All rights reserved.
20503 *
20504 * This source code is licensed under the BSD-style license found in the
20505 * LICENSE file in the root directory of this source tree. An additional grant
20506 * of patent rights can be found in the PATENTS file in the same directory.
20507 *
20508 * @providesModule memoizeStringOnly
20509 * @typechecks static-only
20510 */
20511
20512'use strict';
20513
20514/**
20515 * Memoizes the return value of a function that accepts one string argument.
20516 *
20517 * @param {function} callback
20518 * @return {function}
20519 */
20520function memoizeStringOnly(callback) {
20521 var cache = {};
20522 return function (string) {
20523 if (!cache.hasOwnProperty(string)) {
20524 cache[string] = callback.call(this, string);
20525 }
20526 return cache[string];
20527 };
20528}
20529
20530module.exports = memoizeStringOnly;
20531},{}],169:[function(_dereq_,module,exports){
20532/**
20533 * Copyright 2013-2015, Facebook, Inc.
20534 * All rights reserved.
20535 *
20536 * This source code is licensed under the BSD-style license found in the
20537 * LICENSE file in the root directory of this source tree. An additional grant
20538 * of patent rights can be found in the PATENTS file in the same directory.
20539 *
20540 * @providesModule performance
20541 * @typechecks
20542 */
20543
20544'use strict';
20545
20546var ExecutionEnvironment = _dereq_(147);
20547
20548var performance;
20549
20550if (ExecutionEnvironment.canUseDOM) {
20551 performance = window.performance || window.msPerformance || window.webkitPerformance;
20552}
20553
20554module.exports = performance || {};
20555},{"147":147}],170:[function(_dereq_,module,exports){
20556/**
20557 * Copyright 2013-2015, Facebook, Inc.
20558 * All rights reserved.
20559 *
20560 * This source code is licensed under the BSD-style license found in the
20561 * LICENSE file in the root directory of this source tree. An additional grant
20562 * of patent rights can be found in the PATENTS file in the same directory.
20563 *
20564 * @providesModule performanceNow
20565 * @typechecks
20566 */
20567
20568'use strict';
20569
20570var performance = _dereq_(169);
20571var curPerformance = performance;
20572
20573/**
20574 * Detect if we can use `window.performance.now()` and gracefully fallback to
20575 * `Date.now()` if it doesn't exist. We need to support Firefox < 15 for now
20576 * because of Facebook's testing infrastructure.
20577 */
20578if (!curPerformance || !curPerformance.now) {
20579 curPerformance = Date;
20580}
20581
20582var performanceNow = curPerformance.now.bind(curPerformance);
20583
20584module.exports = performanceNow;
20585},{"169":169}],171:[function(_dereq_,module,exports){
20586/**
20587 * Copyright 2013-2015, Facebook, Inc.
20588 * All rights reserved.
20589 *
20590 * This source code is licensed under the BSD-style license found in the
20591 * LICENSE file in the root directory of this source tree. An additional grant
20592 * of patent rights can be found in the PATENTS file in the same directory.
20593 *
20594 * @providesModule shallowEqual
20595 * @typechecks
20596 *
20597 */
20598
20599'use strict';
20600
20601var hasOwnProperty = Object.prototype.hasOwnProperty;
20602
20603/**
20604 * Performs equality by iterating through keys on an object and returning false
20605 * when any key has values which are not strictly equal between the arguments.
20606 * Returns true when the values of all keys are strictly equal.
20607 */
20608function shallowEqual(objA, objB) {
20609 if (objA === objB) {
20610 return true;
20611 }
20612
20613 if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
20614 return false;
20615 }
20616
20617 var keysA = Object.keys(objA);
20618 var keysB = Object.keys(objB);
20619
20620 if (keysA.length !== keysB.length) {
20621 return false;
20622 }
20623
20624 // Test for A's keys different from B.
20625 var bHasOwnProperty = hasOwnProperty.bind(objB);
20626 for (var i = 0; i < keysA.length; i++) {
20627 if (!bHasOwnProperty(keysA[i]) || objA[keysA[i]] !== objB[keysA[i]]) {
20628 return false;
20629 }
20630 }
20631
20632 return true;
20633}
20634
20635module.exports = shallowEqual;
20636},{}],172:[function(_dereq_,module,exports){
20637/**
20638 * Copyright 2013-2015, Facebook, Inc.
20639 * All rights reserved.
20640 *
20641 * This source code is licensed under the BSD-style license found in the
20642 * LICENSE file in the root directory of this source tree. An additional grant
20643 * of patent rights can be found in the PATENTS file in the same directory.
20644 *
20645 * @providesModule toArray
20646 * @typechecks
20647 */
20648
20649'use strict';
20650
20651var invariant = _dereq_(161);
20652
20653/**
20654 * Convert array-like objects to arrays.
20655 *
20656 * This API assumes the caller knows the contents of the data type. For less
20657 * well defined inputs use createArrayFromMixed.
20658 *
20659 * @param {object|function|filelist} obj
20660 * @return {array}
20661 */
20662function toArray(obj) {
20663 var length = obj.length;
20664
20665 // Some browse builtin objects can report typeof 'function' (e.g. NodeList in
20666 // old versions of Safari).
20667 !(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function')) ? "development" !== 'production' ? invariant(false, 'toArray: Array-like object expected') : invariant(false) : undefined;
20668
20669 !(typeof length === 'number') ? "development" !== 'production' ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : undefined;
20670
20671 !(length === 0 || length - 1 in obj) ? "development" !== 'production' ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : undefined;
20672
20673 // Old IE doesn't give collections access to hasOwnProperty. Assume inputs
20674 // without method will throw during the slice call and skip straight to the
20675 // fallback.
20676 if (obj.hasOwnProperty) {
20677 try {
20678 return Array.prototype.slice.call(obj);
20679 } catch (e) {
20680 // IE < 9 does not support Array#slice on collections objects
20681 }
20682 }
20683
20684 // Fall back to copying key by key. This assumes all keys have a value,
20685 // so will not preserve sparsely populated inputs.
20686 var ret = Array(length);
20687 for (var ii = 0; ii < length; ii++) {
20688 ret[ii] = obj[ii];
20689 }
20690 return ret;
20691}
20692
20693module.exports = toArray;
20694},{"161":161}],173:[function(_dereq_,module,exports){
20695/**
20696 * Copyright 2014-2015, Facebook, Inc.
20697 * All rights reserved.
20698 *
20699 * This source code is licensed under the BSD-style license found in the
20700 * LICENSE file in the root directory of this source tree. An additional grant
20701 * of patent rights can be found in the PATENTS file in the same directory.
20702 *
20703 * @providesModule warning
20704 */
20705
20706'use strict';
20707
20708var emptyFunction = _dereq_(153);
20709
20710/**
20711 * Similar to invariant but only logs a warning if the condition is not met.
20712 * This can be used to log issues in development environments in critical
20713 * paths. Removing the logging code for production environments will keep the
20714 * same logic and follow the same code paths.
20715 */
20716
20717var warning = emptyFunction;
20718
20719if ("development" !== 'production') {
20720 warning = function (condition, format) {
20721 for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
20722 args[_key - 2] = arguments[_key];
20723 }
20724
20725 if (format === undefined) {
20726 throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
20727 }
20728
20729 if (format.indexOf('Failed Composite propType: ') === 0) {
20730 return; // Ignore CompositeComponent proptype check.
20731 }
20732
20733 if (!condition) {
20734 var argIndex = 0;
20735 var message = 'Warning: ' + format.replace(/%s/g, function () {
20736 return args[argIndex++];
20737 });
20738 if (typeof console !== 'undefined') {
20739 console.error(message);
20740 }
20741 try {
20742 // --- Welcome to debugging React ---
20743 // This error was thrown as a convenience so that you can use this stack
20744 // to find the callsite that caused this warning to fire.
20745 throw new Error(message);
20746 } catch (x) {}
20747 }
20748 };
20749}
20750
20751module.exports = warning;
20752},{"153":153}]},{},[1])(1)
20753});